7

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

http://jsfiddle.net/U3djn/

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

user-select works in <div>, but doesn't work in <li> content.

Fabrício Matté
  • 69,329
  • 26
  • 129
  • 166
user2465422
  • 157
  • 2
  • 9

1 Answers1

9

a 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 on:

  • macOS 10.6: latest chome and firefox
  • windows 7: latest chrome and firefox, IE9
  • android 4.2: latest chrome
oezi
  • 51,017
  • 10
  • 98
  • 115