电脑研究
通过CSS禁用页面内容选中和复制操作
要用 CSS 禁止鼠标拖选文字,并禁用页面内容的选中和复制,只需在 body 的样式中加入以下代码。
/* css style: */ html,body{ -moz-user-select: none; -khtml-user-select: none; user-select: none; }
some text
说明:unselectable 针对 IE;onselectstart 针对 Chrome 和 Safari;-moz-user-select 是 Firefox 专有的。
写于 2018/05/05 · Krunk Zhou
一起聊聊