The enabled pseudo-class

The enabled pseudo-class specifies styles for an active input. By active we mean the input that does not have the disabled attribute.

Syntax

cssinput:enabled {
  
}

Example

Let's apply styles for the active input:

html<input>
<input disabled>
cssinput:enabled {
  border: 1px solid green;
  box-shadow: 0 0 3px green;
}

Результат:

See also

  • the disabled pseudo-class
    that sets styles for an inactive input