Menu Samaritan's Purse

ONLY-CHILD

The only-child pseudo-class represents an element that is the only child of its parent.

It is the same as :first-child:last-child or :nth-child(1):nth-last-child(1).

SYNTAX

selector:only-child {
    property: value;
}

EXAMPLES

INTERNAL

first-child

first-of-type

last-child

last-of-type

nth-child

nth-last-child

nth-last-of-type

nth-of-type

only-of-type

EXTERNAL

World Wide Web Consortium (W3C)