The disabled pseudo-class

The disabled pseudo-class specifies styles for an inactive input. By inactive we mean the input that is given the disabled attribute.

Syntax

cssinput:disabled {
  
}

Example

Let's apply styles to the inactive input:

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

Результат:

See also

  • the enabled pseudo-class
    that sets styles for an active input