HTML CSS examples for CSS Selector:read-only
The :read-only selector selects "readonly" elements, who have the "readonly" attribute.
Select if the input element is "readonly":
<!DOCTYPE html> <html> <head> <style> input:-moz-read-only { /* For Firefox */ background-color: yellow; } input:read-only { background-color: yellow; } </style><!--from w w w.ja va 2s .co m--> </head> <body> <input value="hello"> <br><input readonly value="hello"> </body> </html>