CSS3 :disabled Pseudo-class
- Pagina precedente :dir()
- Pagina successiva :empty
- Torna alla pagina superiore Manuale di riferimento dei pseudo-classe CSS
Definition and Usage
CSS :disabled
Pseudo-classes are used to select and set the styles of any disabled element (mainly used for form elements).
Tip::enabled
Pseudo-classes are used to select and set the styles of any enabled element (mainly used for form elements).
Example
Example 1
Set the light gray background color for all disabled <input> elements, and set the yellow background color for all enabled <input> elements:
input:disabled { background-color: lightgray; } input:enabled { background-color: yellow; }
Example 2
Set the background color for all disabled <option> elements:
option:disabled { background-color: lightgray; }
CSS Syntax
:disabled { css declarations; }
Technical Details
Version: | CSS3 |
---|
Browser Support
The numbers in the table specify the first browser version to fully support the pseudo-class.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
4.0 | 9.0 | 3.5 | 3.2 | 9.6 |
Pagine correlate
Riferimento:Pseudo-classe :enabled CSS
- Pagina precedente :dir()
- Pagina successiva :empty
- Torna alla pagina superiore Manuale di riferimento dei pseudo-classe CSS