CSS user-select Property
Description
The user-select property controls whether and how the user can select text and other selectable content inside an element. It governs the interaction model for mouse, touch and keyboard gestures that produce text highlighting and selection handles, and therefore affects behaviors like dragging to highlight, double‑click to select a word, or shift+arrow key expansion of selection. Because selection is a direct part of the user interaction model, changing this property changes what users can copy, drag, or otherwise act upon with native selection gestures.
In practice authors use user-select to prevent accidental highlighting on interactive UI elements (for example, buttons, icons, or drag handles), to create a cleaner drag UX where selecting text would interfere, or to ensure that decorative UI text doesn’t appear selectable. That said, disabling selection can be surprising: users expect to be able to copy visible text, select input labels, and use platform selection features. It’s therefore commonly paired with other interaction-related rules (for pointer behavior and touch gestures) such as pointer-events, touch-action, or cursor to shape the overall affordance and response of an interactive element.
On a technical level user-select affects the visual and gestural selection layer rather than the underlying document content: it changes whether the user can create a selection range via the usual input methods. Scripted operations (the Selection and Range APIs) and platform accessibility tools may still be able to operate independently of the visual selection state depending on the platform. Also, when applied carefully, a parent’s selection rules and a child’s explicit selection rules interact so developers can allow selection in particular subregions (for example, making most of a toolbar unselectable while permitting selection in a nested code block or text field).
Because selection behavior is tied closely to copy/paste expectations and assistive workflows, the general best practice is to use user-select sparingly and only where it clearly improves usability (for example to avoid accidental highlighting during drag operations). Avoid disabling selection for primary content that users might reasonably want to copy or interact with, and test changes with keyboard navigation and assistive technologies. You can also complement selection control with styling of the selection appearance (the ::selection pseudo-element) or with semantic controls like contenteditable and ARIA attributes to preserve accessibility and clarity of intent.
Definition
- Initial value
- auto
- Applies to
- all elements
- Inherited
- no
- Computed value
- as specified
- Animatable
- yes
- JavaScript syntax
- object.style.userSelect
Interactive Demo
User Select Demo
This text is always selectable
This text is not always selectable depending
Syntax
user-select: none | auto | text | all | contain
Values
- noneText cannot be selected by the user.
- autoThe default value. Text can be selected by the user.
- textText can be selected by the user, but only within the element.
- allText can be selected by the user, including text within other elements.
- containText can be selected by the user, but only within the element and its descendants.
Example
Browser Support
The following information will show you the current browser support for the CSS user-select property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
