The :empty pseudo-class represents any element that has no children at all. Only element nodes and text (including whitespace) are considered. Comments or processing instructions do not affect whether an element is considered empty or not.

:empty {
    css declarations;
}
p:empty {
   background: #ffff99;
   width:300px; height:18px;
}

Click the button below to experiment with this selector.

Give it a Try!

3.5Firefox 9.0Explorer 4.0Chrome 3.2Safari 9.6Opera