CSS :enabled Pseudo-class
Example
Set a lightgray background color for all disabled <input> elements, and a yellow background color for all enabled <input> elements:
input:disabled {
background-color: lightgray;
}
input:enabled {
background-color: yellow;
}
Try it Yourself »
Definition and Usage
The :enabled
pseudo-class is used to select
and style any enabled element (mostly used on form elements).
Tip: The
:disabled
pseudo-class is used to select and
style any disabled element (mostly used on form elements).
Version: | CSS3 |
---|
Browser Support
The numbers in the table specifies the first browser version that fully supports the pseudo-class.
Pseudo-class | |||||
---|---|---|---|---|---|
:enabled | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |
CSS Syntax
Related Pages
CSS Reference: :disabled