With both the CSS3 Selectors and CSS3 Namespaces Modules, respectively, having been released as official W3C recommendations (Selectors, Namespaces), I felt compelled to re-review each specification.
Interestingly, while reviewing the CSS3 Selectors Module (my personal favorite), I noticed that the selection
pseudo-element selector which was originally drafted for CSS3 had been dropped from the proposal. In fact, it was dropped a rather long time ago.
In case you are not familiar with the selection
pseudo-element, essentially it allows for defining the text color
and background-color
of selected text within a document.
For example, all <code>
elements on my site have a red background with white text when selected – such as this text here (select it)
– based on the following two simple rules:
And so, while having been dropped, support is already rather good (FF3.6, SA3.1+, OP9.5+, CH2+, IE9) and as far as I am aware Browser vendors will continue to support ::selection.
::selection should not have been considered a pseudo-element or a pseudo-class, it should have been a pseudo-id. This would have fixed the precedence problems.