HTML and CSS Reference
These pseudo-elements are used exclusively for automatic content generation, which is the subject of a
separate chapter. I'll explain how they're used in Chapter 15.
■ The Css3 selectors module originally included a ::selection pseudo-element, which was designed to
add styles to elements selected by the user in the browser. Although it was implemented by some browsers, none of
them implemented it correctly, so it was dropped by the W3C.
This chapter has provided a whirlwind overview of the remaining CSS3 selectors. Among the most useful are
pseudo-classes that make it possible to select elements based on their position in the HTML hierarchy. The CSS3
UI selectors that style form elements according to their dynamic state are another useful group. You can also use
the :not() pseudo-class to exclude specific types of elements. Altogether, there are 52 selectors in CSS3. And it
doesn't stop there. The CSS4 Selectors module is already well advanced, introducing many more. Perhaps the
most exciting future addition is the ability to select the parent of a specific element.
This continuing expansion of selectors is a double-edged sword. It makes it possible to apply styles with
greater accuracy without the need for extra HTML markup. At the same time, it's a pain trying to work out which
selectors have a broad enough level of browser support to make their use practicable. This dilemma is not new to
CSS3, and it's unlikely to end in the foreseeable future. Use the selectors from Chapter 2 to provide a solid layout
and design for all browsers. Then use the more advanced selectors from this chapter to provide an enhanced
experience for users of the most recent browsers.
In the next chapter, we'll take a look at improving the presentation of data tables with CSS.