CSS ::first-line pseudo-element
- Vorige pagina ::first-letter
- Volgende pagina ::grammar-error
- Ga naar de vorige laag CSS Pseudo-element Referentie Handboek
Definition and usage
CSS ::first-line
Pseudo-elements are used to set the style of the first line of block-level elements.
Note:The following properties can be used with ::first-line
Used together:
- All font properties
- All background properties
- color
- text-shadow
- word-spacing
- letter-spacing
- text-transform
- text-decoration
- text-decoration-color
- text-decoration-line
- text-decoration-style
- vertical-align
- line-height
Example
Select and set the style of the first line of each <p> element:
p::first-line { font-size: 20px; text-decoration: underline; background-color: lightgreen; }
CSS syntax
::first-line { css declarations; }
Technical details
Version: | CSS1 |
---|
Browser support
The numbers in the table specify the first browser version that fully supports this pseudo-element.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
1.0 | 9.0 | 1.0 | 1.0 | 7.0 |
Related pages
Tutorial:CSS pseudo-element
- Vorige pagina ::first-letter
- Volgende pagina ::grammar-error
- Ga naar de vorige laag CSS Pseudo-element Referentie Handboek