Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

first line

The first-line pseudo-element selector will target the first formatted line within elements.
Syntax Logicelement::first-line { property_list }

CSS Code Example

<style> p::first-line { color: red; } ul::first-line { color: orange; } </style> <p>My paragraph content...<br /> keeps going...<br />and going...</p> <ul> <li>List item</li> <li>List item</li> <li>List item</li> </ul>

CSS

Selectors

universaltypecompoundclassidnotattributedescendantchildadjacent siblinggeneral siblingfirst childlast childonly childfirst of typelast of typeonly of typenth childnth last childnth of typenth last of typeemptyrootfirst linefirst letterbeforeafterlinkvisitedhoveractivefocustargetenableddisabledcheckedlang