[转]CSS禁止文字选择

user-select有两个值:

none:用户不能选择文本

text:用户可以选择文本

需要注意的是:user-select并不是一个W3C的CSS标准属性,浏览器支持的不完整,需要对每种浏览器进行调整

  • body{
  • -moz-user-select: none; /*火狐*/
  • -webkit-user-select: none; /*webkit浏览器*/
  • -ms-user-select: none; /*IE10*/
  • -khtml-user-select: none; /*早期浏览器*/
  • user-select: none;
  • }

原文:

http://bg4728.blog.163.com/blog/static/192401052201301553045616/

原文地址:https://www.cnblogs.com/simonbaker/p/4157259.html