September 2014
Intermediate to advanced
148 pages
2h 15m
English
CHAPTER 3
![]()
Class and id selectors
Class and id selectors define rules that apply to only a selected set of HTML elements. They allow you to identify individual elements, or groups of elements, without having to style all instances of the element type.
Class selector
The class selector is used to identify a group of elements. It is recognized by the period sign (.), followed by a class name. The class can be a general class that can be applied to any element.
/* Selects any element with class name myclass */.myclass {}
The selector can also be a specific class that can be applied to only one type of element. The specific class is defined by declaring ...
Read now
Unlock full access