November 2000
Intermediate to advanced
384 pages
8h 8m
English
A selector is the element, or group of elements, to which a style will be applied. Selectors can be individual elements, lists of like elements, or specific instances of elements identified by class or ID attributes. In this next section, we'll look at selectors of each type.
Using an element as a selector is pretty straightforward. The style rule is written by giving the element (selector), followed by the property or properties and values bound within braces:
selector {property:value}
Multiple elements that will have the same properties can be grouped to save redundancy in the style sheet document. For instance, you might want all headings to be colored red. Instead of writing
h1 {color:red} ...Read now
Unlock full access