Skip to content

CSS Selectors

Focus (within)

About

The :focus-within pseudo-class matches elements that are either focused themselves or have a descendant that is focused.

Card

The selector matches the card when the input is focused.

  • Focus the input to make the selector match the card

Card with Input