CSS disabled Selector (:disabled)
What is CSS :disabled Selector?
CSS :disabled selector select all <input> element whose are disabled state.
Syntax
General syntax of CSS :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.
<!DOCTYPE html>
<html>
<head>
<title>CSS :disabled Selector</title>
<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>
</html>
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.