CSS3 :disabled Selector

Example

Set a background color for all disabled input elements of type="text":

input[type="text"]:disabled
{
background:#dddddd;
}

Try it yourself »

Definition and Usage

The :disabled selector matches every disabled element (mostly used on form elements).


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The :disabled selector is supported in all major browsers, except Internet Explorer.


Examples

Try it Yourself - Examples


Example

Set a background color for all disabled input elements:

input:disabled
{
background:#dddddd;
}

Try it yourself »