focus-within

The focus-within CSS pseudo-class applies to any element for which the :focus pseudo class applies as well as to an element whose descendant in the flat tree (including non-element nodes, such as text nodes) matches the conditions for matching :focus.

Syntax

selector:focus-within
{
    property: value;
}

Examples

Internal

focus

External

World Wide Web Consortium (W3C)

Home Menu