Attribute Selector Futures: CSS2

Navigator 4 and Internet Explorer 4 implement the individual, class, ID, and contextual selector schemes described in the previous sections. The newer CSS2 specification makes further enhancements to the way selectors can be specified in style sheet rules. Some of these recommendations may find their way into future versions of the browsers (IE 4 already uses a few of them) or other implementations of style sheets (such as in XML-enabled applications). These items are noted here briefly to offer a preview of what you might expect in the next generation of DHTML-capable browsers. However, since specifications like CSS do not insist on 100% compliance (some items are optional), don’t be surprised if some of the items described in this section do not appear in the next version of your browser.

Pseudo-Element and Pseudo-Class Selectors

The original idea for pseudo-elements and pseudo-classes was defined as part of the CSS1 recommendation; these selectors have been expanded in CSS2. A fine line distinguishes these two concepts, but they do share one important factor: there are no direct HTML tag equivalents for the elements or classes described by these selectors. Therefore, you must imagine how the selectors will affect the real tags in your document.

Using pseudo-elements

A pseudo-element is a well-defined chunk of content in an HTML element. Two pseudo-elements specified in the CSS1 recommendation point to the first letter and the first line of ...

Get Dynamic HTML: The Definitive Reference 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.