Horje
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:

  • none: Prevents text selection within the element.
  • auto: Allows the browser to determine whether text can be selected (default behavior).
  • text: Enables text selection within the element.
  • all: Allows users to select everything, including images and other non-text content.




Reffered: https://www.geeksforgeeks.org


CSS

Related
How to make Inline-Level element into Block-Level Element? How to make Inline-Level element into Block-Level Element?
How to style Placeholder Text in an Input Field ? How to style Placeholder Text in an Input Field ?
How to implement the counter-reset Property in CSS ? How to implement the counter-reset Property in CSS ?
How to apply a Filter to an Image in CSS ? How to apply a Filter to an Image in CSS ?
What is the purpose of the object-fit Property? What is the purpose of the object-fit Property?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
13