如果让整个页面都禁止选择,可以使用下面的 CSS
如果希望指定元素禁止访问,请看下面的示例代码:
- type="text/css">
- *.unselectable {
- -moz-user-select: -moz-none;
- -khtml-user-select: none;
- -webkit-user-select: none;
- /*
- Introduced in IE 10.
- See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/
- */
- -ms-user-select: none;
- user-select: none;
- }
- class="unselectable">
- 这是很长的一段文本。啦啦啦啦啦啦
- </html>
来源: http://www.bubuko.com/infodetail-2010166.html