Open In App

How to use the ::first-line pseudo-element in CSS ?

The ::first-line pseudo-element in CSS is used to style the first line of a block-level element. It allows you to apply styles specifically to the first line of text within an element, making it useful for typographic enhancements or creating decorative effects.

Syntax:

selector::first-line {
/* Styles for the first line */
}

Features:

Article Tags :