|
Pseudo-classes and pseudo-elements are special classes and tags. Pseudo-classes distinguish among different tag types, for example, visited links and active links. Pseudo-elements refer to parts of tags, such as the first letter of a paragraph. Here are some examples: a:active {color: blue; font-size: 125%;} p:first-line {text-transform: uppercase;} Each rule is made up of:
The syntax is similar to a normal style rule except the selector is followed by a colon and the pseudo-class or element. The rest of the rule that specifies a property within curly brackets { } is the same as a normal style rule. Each property is identified by the property name, followed by a colon and the property value. You can also apply pseudo classes and elements to selectors with a specific class: p.first:first-letter {font-size: 200%; font-style: italic;} There are several pseudo-classes and pseudo-elements to choose from, look at Pseudo classes and elements for a list and some examples of how to use them. |
More information Use the class attribute as a selector Use the id attribute as a selector Matching attributes and selectors Pseudo classes and elements as selectors |