CSS :first-line Selector
Select and style the first line of every <p> element:
Try it yourself »
Definition and Usage
The :first-line selector is used to add a style to the first line of the specified selector.
Note: The following properties can be used with :first-line:
- font properties
- color properties
- background properties
Note: The "first-line" selector can only be used with block-level elements.
The :first-line selector is supported in all major browsers.
CSS tutorial: CSS Pseudo elements
Complete CSS Selector Reference
Thank You For Helping Us!
Your message has been sent to W3Schools.