CSS user-select Property

The user-select property specifies whether the text of an element can be selected.

In web browsers, if you double-click on some text it will be selected/highlighted. This property can be used to prevent this.

  • auto : It is the default value. If browser allows, text can be selected.
  • text : Text selection is allowed.
  • none
  • all

CSS Syntax

user-select: auto|none|text|all;

Example -