Fake Stuff--Those Pseudo Thingies
Pseudo-Element Selectors
Insert fictional elements. Work with block elements only and only certain CSS properties can be used (Table 2-3, p. 58). Combine with Class selector to refine, but not well supported.
- :first-line (varies with browser width)
- :first-letter (over-rides :first-line)
- :before
- :after
- :before and :after introduce generated content
Pseudo-Class Selectors
React to behaviors rather than document elements.
Anchor/link pseudo classes
- :link
- :visited
- These only work with anchor tag <a>; be careful of user's expectations of how browsers work.
Dynamic pseudo classes
- :focus
- :hover
- :active
- These work with <a> and other tags.
Static pseudo classes
- :first-child--very inconsistent browser support