Web4College

CSS user-select property

src

Description

CSS user-select property tells a user which elements can be selected or how to select. This property can disable selection of the whole text or specific portions of the text.

Syntax

user-select : auto | text | none | all

Property values

autoDefault

If auto is the value of user-select for the current element, it is computed to any of the above given values such as none, all, text.

user-select: auto;
Try it

text

text value does not apply any restriction to the selection of text. And a user can select the text freely.

user-select: text;
Try it

none

none value does not allow a user to select the text i.e. it disables the selection of text.

user-select: none;
Try it

all

If a user selects a part of content of the current element, this selection must include all of the remaining content including the descendant elements (atomically).

user-select: all;
Try it

Applicable to

It applies to all elements