:read-write pseudo-class

Applies one or more styles to specified input fields when the fields are editable.

Syntax

selector:read-write {...}

Parameters

selector

A CSS simple selector.

Standards information

Remarks

A field will be read-write compatible so long as the field is editable. A field that is read-only will not have styles applied to it.

Examples

The following example creates a text field. The read-write selector in this situation would only make the background of the text field pink if the box was editable. Since the text field is not set to read-only, and therefor is editable, the background color will be applied.


<!DOCTYPE html >
<html>
<head>
    <style type="text/css">
        input:read-write { background: #ff00ff; }
    </style>
</head>
<body>
    <form action="" id="numBox">
    <p>
        <label for="input">If the field is editable, the text box will be pink</label>    
        <input id="input" type="text" value="You can read and edit this" />           
    </p>
</form> 
</body>
</html>

See also

Related pseudo-classes
:read-only

 

 

Show: