Skip to content

CSS Selectors

Focus (visible)

About

The :focus-visible pseudo-class matches the element that is currently focused, if the focus state is visible. Whether the focus state is visible depends on the input method used to focus the element and the element itself.

Button

The button matches the :focus-visible selector when focused via keyboard.

  • Focus the button via keyboard

Input

The input element matches even when focused via mouse.

  • Focus the input