asp.net.ph

Skip Navigation LinksAbakada: Back to Basics > Language References > CSS Properties > Pseudo-Classes > empty Pseudo-class

:empty Pseudo-class


Represents an element that has no children.

Syntax

selector:empty { property: value; }

Possible Values

property Any valid CSS property.
value Any of the range of values available to the corresponding property.

Remarks

The :empty pseudo-class applies styles to elements that have no children.

The syntax for using the :empty pseudo-class is straightforward. A selector immediately precedes the pseudo-class.

For example, to change the background color of empty elements on a page.

div:empty { background-color: beige }

Example

The following demonstrates use of the :empty pseudo-class in an embedded stylesheet to set the style of empty elements on a page.

External References

See Also

:disabled   :enabled



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note