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

CSS :first-line pseudo-element

CSS :first-line selector

Complete CSS SelectorComplete CSS Selector Reference Manual

Example

Each

Style selected for the first line of an element:

p:first-line

{

background-color:yellow;

}

Try it »


Definition and Usage

:first-line selector is used to specify the style of the first line of a selector.

Note::first-line selector can use the following properties: 

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


Browser support

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

Selector
::first-line 1.0 9.0
Partially supported from 5.5 1.0 1.0 7.0
Partially supported from 3.5

Related Articles

CSS Tutorial: CSS pseudo-classes


Complete CSS SelectorComplete CSS Selector Reference Manual