Skip to content

CSS Selectors

Focus (visible)


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.


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

  • Focus the button via keyboard


The input element matches even when focused via mouse.

  • Focus the input