Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset -moz-user-select to be selectable?

Tags:

html

css

I have applied * {-moz-user-select: none;} to the main stylesheet, because there are more unselectable elements than those that are selectable. I then tried to set -moz-user-select: auto; to an input, but it does not work. I have also tried the value of text and all, both do not work.

Also it seems that user-select does not work in IE9 and Opera 10.62 or am I missing something?

I am trying to disable selection by default for all browsers, and then explicitly enable it for some elements like input.

like image 948
Tower Avatar asked Oct 03 '10 13:10

Tower


1 Answers

Why oh why are you using the universal selector? Please, you have to be more specific with your selectors than that.

As to the answer to your question, reading the MDC documentations carefully, you'll see that the -moz-none value is the one you're looking for, not none:

-moz-none

The text of the element and sub-elements cannot be selected, but selection can be enabled on sub-elements using -moz-user-select: text.

Set this to the universal selector, and you'll be fine. See this demo to see it working live: http://jsfiddle.net/KqJ7R/

like image 137
Yi Jiang Avatar answered Nov 01 '22 12:11

Yi Jiang