:only-child

Term side of the Card
Topic: Pseudo Classes
Unit title: :only-child
Categories: Pseudo-class
Explanation side of the Card

Explanation: The pseudo-class that selects an element that is the only child of its parent. It targets elements that have no siblings, enabling to style such elements uniquely when they are the sole child of their container.

Browser compatibility:
  • The chrome browser supports this feature starting from version 2
  • The edge browser supports this feature starting from version 12
  • The firefox browser supports this feature starting from version 1.5
  • The safari browser supports this feature starting from version 3.1
Availability: