How to disable text selection IN <li>

I'm having trouble disabling text selection in the <li> element.

http://jsfiddle.net/U3djn/

 <ul> <li>Text</li> </ul> 

user-select works in <div> , but does not work in <li> content.

+4
source share
1 answer

the combination of user-select: none and cursor: default works:

jsFiddle

 ul li { -moz-user-select: -moz-none; -khtml-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; cursor: default; } 

tested for:

  • macOS 10.6: latest chome and firefox
  • windows 7: latest chrome and firefox, IE9
  • android 4.2: last chrome
+6
source

Source: https://habr.com/ru/post/1485244/


All Articles