Abakada: Back to Basics > Language References > CSS Properties > Pseudo-Classes > disabled Pseudo-class
Represents user interface elements that are in a disabled state.
selector:disabled { property: value; }
property |
Any valid CSS property. |
value |
Any of the range of values available to the corresponding property. |
The :disabled pseudo-class applies styles to elements that are in a disabled state.
An element is disabled if it cannot be activated ( selected, clicked on, typed into, etc. ) or accept focus.
The syntax for using the :disabled pseudo-class is straightforward. A selector immediately precedes the pseudo-class.
For example, to change the background color of disabled input elements on a page.
input:disabled { background-color: beige }
The following demonstrates use of the :disabled pseudo-class in an embedded stylesheet to set the style of disabled input elements on a page.
:empty :enabled