Open In App

What is the use of the user-select Property?

The user-select property in CSS is used to control the user’s ability to select text. It allows you to define whether text within an element can be selected, preventing or allowing users to highlight and copy content.

Note: The user-select property can take values such as none, auto, text, and all.



/* Disabling text selection within an element */
.unselectable {
user-select: none;
}

/* Allowing text selection within an element */
.selectable {
user-select: text;
}

Features:

The user-select properties are as:



Article Tags :