: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
Explorer Edge Chrome Firefox Opera Safari
9121193.1
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
218410.13.1X