Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

first child

The first-child structural pseudo-class selector will target the first nested element of the specified type or selector.
Syntax Logicelement:first-child { property_list }

CSS Code Example

<style> p:first-child { color: skyblue; } </style> <article> <p>Paragraph content...</p> <p>Paragraph content...</p> <p>Paragraph content...</p> </article> <article> <p>Paragraph content...</p> <p>Paragraph content...</p> <p>Paragraph content...</p> </article>

CSS

Selectors

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