CSS user-select property

CSS user-select

CSS user-select is used to specify if an element can be selected or not.

In web pages, it is possible to select or highlight some text by double clicking. In order to prevent it, this property can be used.

user-select property values are,

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

To support align-items property on different browsers we need to add some prefixes, they are

  • -webkit- : It supports chrome, safari and new version of opera
  • -moz- : It support Firefox.
  • -o- : Old versions of opera.
  • -ms- : Internet explorer.

none value for user-select property

Text selection is blocked.

Example

Try Yourself

all value for user-select property

The whole content can be selected by a single click, instead of double click..

Example

Try Yourself