Prev | Current Page 156 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

0 5.5
None Full Full Full Full Full Full None None None
This pseudo-class is currently only supported by Firefox and Safari.
Pseudo-elements
Pseudo-elements match virtual elements that don??™t exist explicitly in the document
tree. Pseudo-elements can be dynamic, inasmuch as the virtual elements they
represent can change, for example, when the width of the browser window is altered.
They can also represent content that??™s generated by CSS rules.
In CSS1 and CSS2, pseudo-elements start with a colon (:), just like pseudo-classes.
In CSS3, pseudo-elements start with a double colon (::), which differentiates them
from pseudo-classes.
CSS1 gave us :first-letter (p. 107) and :first-line (p. 110); CSS2 gave us
generated content and the :before (p. 113) and :after (p. 114) pseudo-elements;
and CSS3 added ::selection (p. 115).
SPEC
CSS1
BROWSER SUPPORT
Op9.2+ Saf1.3+ FF1+ IE5.5+
BUGGY FULL BUGGY BUGGY
:first-letter
:first-letter {
declaration block
}
Example
The following example selector will match
the first letter of a p element:
p:first-letter {
?‹® declarations
}
The :first-letter pseudo-element is
mainly used for creating common
typographical effects like drop caps.


Pages:
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168