:disabled CSS Pseudo Class
Description
The :disabled
pseudo-class is used to apply style to locked form elements. Such elements cannot receive focus, be pressed or activated, text cannot be typed in text fields.
Syntax
element:disabled { … }
Example
<form>
<textarea disabled cols="30" rows="5">This is a disabled textarea, you can not enter any text here.</textarea>
</form>
textarea:disabled {
border: 1px dashed #666;
padding: 5px;
font-style: italic;
}
Browser Support
Desktop | |||||
9 | 12 | 1 | 1 | 9 | 3.1 |
Tablets / Mobile | |||||
![]() |
|||||
2 | 18 | 4 | 10.1 | 3.1 | X |
Last updated by CSSPortal on: 25th November 2019
CSS Pseudo Elements
CSS Pseudo Classes
- :active
- :checked
- :default
- :disabled
- :empty
- :enabled
- :first-child
- :first-of-type
- :focus
- :fullscreen
- :hover
- :in-range
- :indeterminate
- :invalid
- :lang
- :last-child
- :last-of-type
- :link
- :not
- :nth-child
- :nth-last-child
- :nth-last-of-type
- :nth-of-type
- :only-child
- :only-of-type
- :optional
- :out-of-range
- :read-only
- :read-write
- :required
- :root
- :target
- :valid
- :visited