CSS: first-letter pseudo-element
CSS selectors complete reference manual
Examples
First letter of each <p> element selected style:
p: first-letter
{
font-size: 200%;
color: # 8A2BE2;
}
{
font-size: 200%;
color: # 8A2BE2;
}
try it"
Definition and Usage
: First-letter selector element is used to specify the first letter style.
Tip:: first-letter selector can use the following properties:
- font properties
- color properties
- background properties
- margin properties
- padding properties
- border properties
- text-decoration
- vertical-align (only if float is 'none')
- text-transform
- line-height
- float
- clear
Note: "first-letter" selector only applies to block-level elements.
Browser Support
Figures in the table represent the first browser to support the version number of the property.
选择器 | |||||
---|---|---|---|---|---|
::first-letter | 1.0 | 9.0 部分从5.5 |
1.0 | 1.0 | 7.0 部分从5.5 |
Note: IE 5.5-8 and Opera 4-6 only support the old syntax standard, single-colon CSS2 syntax (: first-letter).The new version supports standard double colon CSS3 syntax (:: letter).
Related Pages
CSS tutorial: CSS pseudo-classes