:disabled - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:disabled

Description

The :disabled selector selects disabled elements.

Example

Set a background color for all disabled <input> elements:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
input:enabled {<!--   ww  w  . jav a2s . co  m-->
    background: #ffff00;
}

input:disabled {
    background: #dddddd;
}
</style>
</head>
<body>

<form action="">
First name: <input type="text" value="Java"><br>
Last name: <input type="text" value="SQL"><br>
Country:<input type="text" value="Oracle" disabled><br>
Password: <input type="password" name="password" value="psw" disabled><br>
E-mail: <input type="email" value="a@example.com" name="usremail">
</form>

</body>
</html>

Related Tutorials