:only-of-type

:only-of-type – pseudo-class | Selectors Level 3

The :only-of-type matches element that is only child of its parent element of given type.

Syntax

element:only-of-type{
  /* ... */
}
:only-of-type {
  /* ... */
}

See the Pen :only-of-type by majadc (@majadc) on CodePen.

Related

Resources

Posted in CSS

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.