Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

empty

The empty structural pseudo-class selector will target an empty element that has no child elements, text nodes or whitespace.
Syntax Logicelement:empty { property_list }

CSS Code Example

<style> li:empty { background: lightgrey; } </style> <ul> <li>List item</li> <li></li> <li> </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