Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS 3.0 user-select property replacement

I am using CSS 3.0 and it is complaining that the "user-select" property doesn't exist. Does anyone know what the appropriate substitute or replacement is?

like image 951
MikeTWebb Avatar asked Nov 16 '11 13:11

MikeTWebb


People also ask

How do you select content in CSS?

The * selector selects all elements. The * selector can also select all elements inside another element (See "More Examples").


1 Answers

user-select is back in the specification for CSS Basic User Interface Module Level 4. It is supported by most modern browsers (according to MDN), either prefixed or unprefixed.

#something {
    user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
}

user-select was defined as part of User Interface for CSS3, which was later superseded by CSS3 Basic User Interface Module. However, the latter document does not include specification of user-select. After searching recently, I was unable to find any discussion on why it might have been removed from the spec.

See also: my answer on disabling text selection is not working in IE using jquery.

like image 160
Andy E Avatar answered Sep 28 '22 03:09

Andy E