CSS :first-line pseudo-element
ExampleHow to style the first line of all <p> elements:
Try it yourself » |
Definition and Usage
The :first-line pseudo-element adds a style to the first line of the specified selector.
Note: The following properties apply to the :first-line pseudo-element:
- font properties
- color properties
- background properties
- word-spacing
- letter-spacing
- text-decoration
- vertical-align
- text-transform
- line-height
- clear
Browser Support
The :first-line selector is supported in all major browsers.
CSS Version
The :first-line selector was first introduced in:
CSS 1
Related Pages
CSS tutorial: CSS Pseudo elements
Try it Yourself - Examples |
Pseudo-elements can also be combined with other CSS selectors:
ExampleHow to style the first line of all <p> elements with class="intro":
Try it yourself » |
Complete CSS Reference