This page is part of the CSS3.info CSS selectors test. See more info on CSS3 selectors.

  1. :empty {
    }
    
    <div></div>

    The CSS selector should match the div element, because it is empty

  2. :empty {
    }
    
    <div><!-- Just a comment --></div>

    The CSS selector should match the div element, because it is empty

  3. :empty {
    }
    
    <div> </div>

    The CSS selector should not match the div element, because it is not empty

  4. .
    :empty {
    }
    
    <div> 
       How about regular text...
    </div>

    The CSS selector should not match the div element, because it is not empty

  5. :empty {
    }
    
    <div><blockquote></blockquote></div>

    The CSS selector should not match the div element, because it is not empty

  6. :empty {
    }
    
    <div id='appendChild'></div>
    
    var ib = document.getElementById('appendChild');
    ib.appendChild(document.createElement("div"));

    The CSS selector should not match the orignal div element, because it will not be empty anymore after the Javascript code appends a child element to it.