This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

user-select

Summary

Controls the visible highlighting of selections of text and elements. It is possible to blind out selection completely or to allow the selection of text only.

Overview table

Initial value
all
Applies to
Visible elements
Inherited
Yes
Media
visual

Computed value
:

Animatable
No

CSS Object Model Property
:

Syntax

  • user-select: all
  • user-select: element
  • user-select: none
  • user-select: text

Values

none
None of the descendants of the element can be selected, neither text nor images.
text
Only text of the element and its descendants can be selected.
all
Default. Everything, text and images, can be selected.
element
Only specified elements can be selected. Only supported in Firefox and Internet Explorer.

Examples

Deactivate selection of text for elements with the class no-select.

.no-select {
    user-select: none;
}

View live example

Usage

 Needs vendor prefixes.

Notes

Also works on mobile devices to suppress selection by touch and hold.

Related specifications

User Interface for CSS3
W3C Working Draft

See also

Related articles

CSS Attributes

Related pages

Attributions