CSS Tutorial

CSS Style

CSS Layout Style

CSS Float Style

CSS Reference

CSS disabled Selector (:disabled)


What is :disabled Selector?

CSS :disabled selector select all <input> element whose are disabled state.

Browser Compatibility

  • Google Chrome 2+
  • Mozilla Firefox 1.5+
  • Internet Explorer 9+
  • Opera 9.2+
  • Safari 3.1+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.

Syntax

General syntax of :disabled selector,

:disabled {
	property: value;
	property: value;
	...
}

input:disabled {
	property: value;
	property: value;
	...
}

Example:

CSS :disabled selector select all <input> element whose are disabled state.

<style type="text/css">
    input:disabled{
        background-color: yellow;
    }
</style>
</head>
<body>
    <input type="text" name="username" placeholder="Username" />  <br /><br />
    <input type="password" name="password" placeholder="Password" disabled />    
</body>

Run it...   »

Example Result: