Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

CSS | :empty Selector

  • Last Updated : 04 Dec, 2018

The :empty selector is used to select that element which does not contain any children (including text node).


:empty {
    // CSS property


<!DOCTYPE html>
        <title>empty selector</title>
            h1 {
            div:empty {
                width: 150px;
                height: 20px;
                background: green;
            <h2>:empty selector</h2>
            <div>A computer science portal for geeks</div>


Supported Browsers: The browser supported by :empty selector are listed below:

  • Apple Safari 3.2
  • Google Chrome 4.0
  • Firefox 3.5
  • Opera 9.6
  • Internet Explorer 9.0

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!