CSS3 :only-of-type Selector

Last Updated Jul 21, 2015, 12:00:06 PM





CSS3 :only-of-type Selector

CSS :only-of-type selector matches every element that is the only child of its type, of its parent.

Syntax Example

Specify a background color for every <p> element that is the only child of its type, of its parent:


Try It Now

CSs Selectors Reference

Other CSS selectors you might want to learn

css first-line selector

css first-letter selector

css first-of-type selector

css not selector



Sources and Credits

The source of the content has been referred and updated with Mozilla Foundation and W3C Organization

Last Updated Jul 21, 2015, 12:00:06 PM