4

PSEUDO-CLASSES AND PSEUDO-ELEMENTS

Image

The very first CSS specification, CSS1, introduced the concepts of pseudo-classes and pseudo-elements. These are selectors that act on information about elements that extends (or sits outside of) the document tree. A pseudo-class differentiates among an element’s different states or types; these include—but are not limited to—those that provide information about link states: :hover, :visited, :active, and so on. A pseudo-element provides access to an element’s subpart, which includes those pseudo-elements that select portions of text nodes; for instance, :first-line and :first-letter.

The selectors just mentioned ...

Get The Book of CSS3, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.