The :read-only
selector selects elements with
a "readonly" attribute.
:read-only { style properties }
:read-only |
Yes | No | Yes | Yes | Yes |
<!DOCTYPE html>
<html>
<head>
<style>
input:-moz-read-only { /* For Firefox */
background-color: red;
}<!-- www . j a v a2 s. c o m-->
input:read-only {
background-color: red;
}
</style>
</head>
<body>
<p>A normal input element:<br><input value="hello"></p>
<p>A readonly input element:<br><input readonly value="hello"></p>
</body>
</html>