HTML and CSS Reference
In-Depth Information
Applies to:
Any element
Matches elements that have no child nodes; that is, no child elements orcontent nodes. Con-
tent nodes are defined as any text, whitespace, entity reference, or CDATA nodes. Thus, <p>
</p> is notempty; nor is the element empty if the space is replaced with a newline. Note that
this pseudo-class does notapply to empty elements such as br , img , input , and so on.
p:empty {padding: 1em; background: red;}
li:empty {display: none;}
Search WWH ::

Custom Search