Using the :empty Selector

Description

The :empty selector matches elements with no children.

Example


<!DOCTYPE HTML> 
<html> 
    <head> 
        <style type="text/css"> 
        :empty { 
            border: thin black solid; 
            padding: 4px; 
        } 
        </style> 
    </head> 
    <body> 
        <a href="http://java2s.com">Visit the java2s.com</a> 
        <a href="http://w3c.org"></a> 
    </body> 
</html>




















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table