empty Selector

empty Selector
CSS empty Selector reference
The CSS empty structural pseudo-class selector ( X:empty ) is used to target and style an empty element that has no child elements including text nodes.
CSS CODE EXAMPLE
<!DOCTYPE html>
<style type="text/css">
ul li:empty { background-color:#CCC; }
</style>
<ul>
  <li>List item</li>
  <li></li>
  <li>List item</li>
</ul>
 
  • List item
  • List item

0 Response to "empty Selector"

Post a Comment