Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS :first-letter pseudo-element

CSS :first-letter selector

Complete CSS SelectorComplete CSS Selector Reference Manual

Example

Each

Style selected for the first letter of an element:

p:first-letter

{

font-size:200%;

color:#8A2BE2;

}

Try it »


Definition and Usage

:first-letter selector is used to specify the style of the first letter of an element.

Tip: :first-letter selector can use the following properties: 

Note: The "first-letter" selector only applies to block-level elements.


Browser support

The numbers in the table indicate the first browser version that supports this property.

Selector
::first-letter 1.0 9.0
Partially supported from 5.5 1.0 1.0 7.0
Partially supported from 5.5

**Note:** IE 5.5-8 and Opera 4-6 only support the old syntax standard, the single-colon CSS2 syntax (:first-letter). Newer versions support the standard double-colon CSS3 syntax (::first-letter).


Related Pages

CSS Tutorial: CSS pseudo-classes


Complete CSS SelectorComplete CSS Selector Reference Manual