The user-select property controls whether the user can select text in an element with the mouse, touch, or keyboard.
The initial value is auto. Common values are none (block selection), text (allow selection), and all (select the whole element atomically). It does not affect browser chrome, except inside textboxes. Include -webkit-user-select for Safari.
Limited availability Not Baseline
MDN marks user-select as Limited availability. Core keywords still work widely when you also set -webkit-user-select. The spec value contain is not supported in browsers.
Syntax
CSS Syntax
syntax.css
user-select:auto | none | text | all | initial | inherit;
Click or drag inside — the whole command should select.
How It Works
Set all. Selection is atomic for this element.
Partial drag expands. Starting inside still selects the whole node and descendants.
Handy for copy-paste. Short commands and IDs are easier to grab in one gesture.
Not contain. Do not rely on contain — browsers do not support it yet.
Edge Cases & Pitfalls
If selection still works (or never works), check these first.
safari
Need -webkit-user-select
Safari historically requires the prefixed property. Set both -webkit-user-select and user-select.
a11y
Do not lock readable content
Blocking selection on paragraphs, docs, or error messages hurts users who copy text. Prefer none only on chrome/controls.
inherit
Spec vs engines
Per the spec, user-select is not inherited, but auto often behaves as if it were. Chromium/WebKit may treat it as inherited — set children explicitly when unsure.
contain
contain is unsupported
The CSS UI module defines contain, but no major browser ships it. Do not use it in production.
api
none is not a security boundary
Script can still read text from the DOM. Selection APIs may still include nodes marked none. Do not treat this as copy protection.
Compatibility
Browser Support
user-select is a browser CSS property for text selection. Node.js, Deno, and Bun do not apply it.
✓ Limited availability
user-select
none, text, auto, and all are practical across modern browsers when you include -webkit-user-select for Safari. MDN marks the feature Limited availability. contain has no browser support.
90%Practical support
Google Chrome54+
Full support
Mozilla Firefox69+
Full support
Apple Safari3.1+*
Prefixed
Microsoft Edge79+
Full support
Opera41+
Full support
Samsung Internet6.2+
Full support
Internet Explorer10+*
Partial / prefixed
user-selectUse with -webkit-
Bottom line: *Prefer -webkit-user-select alongside user-select. Safe for UI controls; avoid locking body copy. It is not a runtime API.
Remember
Key Takeaways
Role: allow or block user text selection in an element.
Initial value:auto — usually behaves like selectable text.
none vs all: block selection vs grab the whole element at once.
Prefix + caution: use -webkit-; never treat none as copy protection.
One line: use none on UI chrome, text/all when users should copy, and always add the WebKit prefix.
Frequently Asked Questions
It controls whether the user can select text in an element with the mouse, touch, or keyboard. It does not affect browser chrome, except in textboxes.
The initial value is auto. Its used value usually resolves to text, or follows a parent’s none/all in some cases.
Set user-select: none (and -webkit-user-select: none for Safari) on the button or control so clicks and drags do not highlight label text.
none makes the element’s text unselectable. text allows normal selection inside the element.
Per the spec it is not inherited, but auto often behaves as if it were. Chromium/WebKit historically treat it as inherited; prefer explicit values on children when needed.
none, text, auto, and all are widely usable with -webkit-user-select for Safari. MDN marks the property Limited availability. contain is not supported. It is a browser CSS property, not a Node.js feature.