The :read-write pseudo-class styles form fields users can edit. Pair it with :read-only to give editable inputs a bright, interactive look that stands out from locked values.
01
Editable
User can type.
02
:read-only
Locked pair.
03
input
Text fields.
04
textarea
Multi-line.
05
:focus
Focus ring.
06
vs disabled
Active fields.
Fundamentals
Introduction
The CSS :read-write selector targets form elements that users can edit — fields where they can type, paste, or modify content. It matches <input> and <textarea> elements that are not marked readonly or disabled.
It is the counterpart to :read-only. Use :read-write to highlight fields users should interact with, making forms clearer and more intuitive.
Definition and Usage
Use :read-write on its own or scoped: input:read-write or textarea:read-write. Combine with :focus for enhanced focus styling on editable fields.
💡
Beginner Tip
Always pair :read-write with :read-only in the same form. Editable fields get bright styling; locked fields get muted gray styling. Users instantly know what they can change.
Foundation
📝 Syntax
The syntax for the :read-write pseudo-class is:
syntax.css
:read-write{/* CSS properties */}
The :read-write pseudo-class targets form controls that accept user input and are not locked or disabled.
The invite code is locked with readonly and styled via :read-only. Name and email fields match :read-write with green focus rings when the user clicks in.
Tips
💬 Usage Tips
Pair with :read-only — Always style both states in mixed forms for clear contrast.
Add :focus styling — Use input:read-write:focus for accessible focus rings.
Scope selectors — Use input:read-write within form wrappers.
Bright = editable — White backgrounds and colored borders signal interactivity.
Exclude disabled — Disabled fields won’t match; style them with :disabled.
Test mixed forms — Verify readonly, editable, and disabled fields each get correct styles.
Watch Out
⚠️ Common Pitfalls
Confusing with :enabled — :enabled only checks disabled; :read-write also excludes readonly.
Combine with :focus for enhanced feedback during interaction.
UX
=
✎
Clear editable feedback
Users know exactly which fields they can change.
Compatibility
🖥 Browser Compatibility
The :read-write pseudo-class is supported in all modern browsers.
✓ Baseline · Modern browsers
Editable field styling everywhere
:read-write works in Chrome, Firefox, Safari, Edge, and Opera.
99%Global support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions
Full support
OperaAll versions
Full support
:read-write pseudo-class99% supported
Bottom line: Safe for all modern form UI. Pair with :read-only for complete field state styling.
Wrap Up
🎉 Conclusion
The :read-write selector is a handy pseudo-class for styling editable fields, allowing you to visually distinguish elements users can interact with from those they cannot. By applying bright, focused styling, you enhance user experience and provide clear visual cues for writable content.
Pair it with :read-only in every mixed form, add :focus rings for accessibility, and remember that styling is a UX aid — always validate on the server.
Use these points when styling editable form fields.
5
Core concepts
✎01
Editable
User can type.
Purpose
:ro02
:read-only
Locked pair.
Tip
:focus03
Focus ring
Accessibility.
A11y
🚫04
Not disabled
Active fields.
State
🌐05
99% support
All browsers.
Compat
❓ Frequently Asked Questions
The :read-write pseudo-class matches form elements that users can edit — fields without the readonly attribute that are not disabled. It lets you style writable inputs and textareas with distinct visual treatment.
:read-write applies to editable input and textarea elements, and to elements with contenteditable set to true. It does not match fields with readonly or disabled attributes.
:read-write matches editable fields users can type into. :read-only matches the opposite — fields locked with the readonly attribute. They are natural pairs for form styling.
No. Disabled fields are not editable and do not match :read-write. Use :disabled for inactive controls and :read-write only for fields users can interact with.
:read-write is supported in all modern browsers including Chrome, Firefox, Safari, and Edge.