HTML CSS examples for CSS Selector:disabled
The :disabled selector selects disabled elements.
Set a background color for all disabled <input> elements:
<!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>