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