css禁止文字被选中】的更多相关文章

有时候,为了让用户有更好的体验,需要禁用掉文本选中功能 比如:使用a标签模拟按钮,如果不禁用掉文本选中功能,那么双击时会选中文字,用起来很不爽. 多数情况下,只需要使用CSS样式就可以实现这个功能啦: 1 body{ 2 -o-user-select: none; 3 -moz-user-select: none; /*火狐 firefox*/ 4 -webkit-user-select: none; /*webkit浏览器*/ 5 -ms-user-select: none; /*IE10+*…
css 禁止文本被选中复制代码: .cus-text{ -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; 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;…
div{ -moz-user-select:none;/*火狐*/ -webkit-user-select:none;/*webkit浏览器*/ -ms-user-select:none;/*IE10*/ -khtml-user-select:none;/*早期浏览器*/ user-select:none; } <section onselectstart="return false;">这又是一段文字</section> 如果把上述的方法写到body中,就实现…
高版本浏览器的处理方式 -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; IE10以下等低版本浏览器中需要添加unselectable="on" 才会有效果 js 实现  onselectstart="return false&quo…
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; /*早期浏览器*/ u…
在我们日常的Java web前端开发的过程中呢,程序员们会遇到各种各样的要求,所以不每天学的东西感觉自己都退步了,都更不上时代的发展了. 每天应对各种需求,每天活在疑问中就是我们程序员的真是写照.但我们还是一样热爱生活,热爱Java,HTML ,JSP. 在昨天的文章中,我写了关于Javascript中null 与 undefined 的区别.好像大家都不怎么感兴趣,小编感到很失落,不过,没事,小编还是一如既往的更新,让大家带来一些前端的干货. 干货:前端开发css禁止选中文本 如何禁止选中文字…
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-us…
CSS设置文字不能被选中 /*设置文字不能被选中 以下为css样式*/ -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;…
有时候,我们希望阻止用户选中我们指定区域的文字或内容. 举个栗子,有时候用户在一个区域执行频繁的点击操作,一不小心傲娇地点多了,就会选中当前区域的内容. 再举个栗子,制作轮播组件的时候,点击下一页,若点击的快的话,浏览器会识别为双击. 双击的默认效果是选中整片区域,这时候轮播图组件就会被表示忧郁的蓝色幕布盖住,多忧桑啊~ 你看,这妹子多赞啊,可是你一紧张就乱点下一张的话,就变成酱紫了: 不过别怕,给这个现代化浏览器说好了咱不要这种忧桑色调就可以了: .pretty-girl { -webkit-…