pseudo-element
::first-line — CSS reference
Styles the first formatted line, whose text changes as the available inline width or font changes. A restricted set of properties applies, so it cannot serve as a general block wrapper.
Formal Syntax & Structure
css syntaxcss
p::first-line { color: teal; }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a {width:12ch;color:#202020} #a::first-line {color:#006050}</style><body><p id="a">A narrow paragraph wraps into several lines for this example.</p></body></html>