The user-selection property controls the how users are able
to select content within an element.
.example {
user-select: none;
user-select: auto; /* initial value */
user-select: text;
user-select: contain;
user-select: all;
}
The default behavious will allow users to double-click to select parts of the content.
Users cannot double-click to select any of the content. This option is useful for interactive elements such as buttons.
.example2 {
user-select: none;
}
Users click to select all sub-elements. This option is useful for content areas where users may want to easily copy entire chunks of content.
Click anwhere within this content: Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
.example2 {
user-select: all;
}