Easy Tutorial
❮ Func Counter Pr List Style Image ❯

CSS :read-only Selector

Complete CSS Selectors Reference

Example

If an input element has the "readonly" attribute set, style the input box yellow:


Definition and Usage

The :read-only selector is used to select elements that have the "readonly" attribute set.

Form elements can have the "readonly" attribute to define elements as read-only.

Note: Currently, most browsers support the :read-only selector for input and textarea elements, but it also applies to elements with the "readonly" attribute set.


Browser Support

The numbers in the table indicate the first browser version that supports the attribute.

Selector
:read-only Supported Not supported -moz- Yes Yes

CSS Syntax


Related Pages

CSS Selector :read-write


Complete CSS Selectors Reference

❮ Func Counter Pr List Style Image ❯