css禁止双击dom节点被选中user-select:none

  • Post author:
  • Post category:其他



css禁止dom节点被选中:


当某个dom节点在快速重复点击的时候出现这个节点被选中,有时候其实并不希望出现这种情况,比如我们使用一个span或者a标签做为按钮dom元素的时候,快速双击这个按钮,就会出现按钮被选中,



禁止这个特性可以使用css属性:user-select:none


moz-user-select: -moz-none;
-moz-user-select: none;
-o-user-select:none;
-khtml-user-select:none;
-webkit-user-select:none; -ms-user-select:none; user-select:none;

(此处转发别人的)参考链接地址:http://www.51xuediannao.com/html+css/htmlcssjq/user-select.html

转载于:https://www.cnblogs.com/hbqfr/p/6225132.html