.noselect {

-webkit-touch-callout: none; /* iOS Safari */

-webkit-user-select: none; /* Chrome/Safari/Opera */

-khtml-user-select: none; /* Konqueror */

-moz-user-select: none; /* Firefox */

-ms-user-select: none; /* Internet Explorer/Edge */

user-select: none; /* Non-prefixed version, currently

not supported by any browser */

}
<div class="reduce noselect" unselectable="on">-</div>     

 

 

在 IE < 10 和Opera < 15中我们需要在需要禁止选中的元素上面添加一个属性

unselectable="on",否则可能不会生效哦~不过现代浏览器如果不是非得兼容一些老的浏览器也可以不加。

 

相关文章:

  • 2021-11-12
  • 2022-12-23
  • 2021-08-24
  • 2021-09-22
  • 2022-02-03
猜你喜欢
  • 2021-10-05
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
相关资源
相似解决方案