:read-write

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2020.

The :read-write CSS pseudo-class represents an element (such as input or textarea) that is editable by the user.

Try it

label,
input[type="submit"] {
  display: block;
  margin-top: 1em;
}

*:read-write {
  background-color: ivory;
  border: 2px solid darkorange;
  border-radius: 5px;
}

Please fill in your details:

Syntax

css
:read-write {
  /* ... */
}

Examples

Confirming form information in read-only/read-write controls

One use of readonly form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form. We do just this in the example below.

The :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs. The :read-write pseudo-class on the other hand is used to provide some nicer styling to the editable \n\n \n \n\n \n\n"}},{"type":"prose","value":{"id":"syntax","title":"Syntax","isH3":false,"content":"

css
:read-write {\n  /* ... */\n}\n"}},{"type":"prose","value":{"id":"examples","title":"Examples","isH3":false,"content":""}},{"type":"prose","value":{"id":"confirming_form_information_in_read-onlyread-write_controls","title":"Confirming form information in read-only/read-write controls","isH3":true,"content":"

One use of readonly form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form. We do just this in the example below.\n

The :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs. The :read-write pseudo-class on the other hand is used to provide some nicer styling to the editable