Visit Mozilla.org

CSS::empty

From MDC

« CSS Reference

[edit] Summary

The :empty pseudo-class matches an element that has no child nodes at all. Only when there are element nodes or text nodes with one or more characters inside the element, the element becomes non-empty.

[edit] Syntax

span:empty { style properties }


[edit] Examples

span:empty::before
{
    background-color: lime;
}

...where...

  <span></span>

[edit] Notes