:focus

The :focus pseudo-class is applied when an element receives focus, either when the user selects it with the keyboard or when it is activated with the mouse (for example, when entering a form).

Syntax



element:focus {
  property: value;
}