鼠标拖拽、双击出现蓝色背景的去掉方法

2020-04-08  本文已影响0人  丁小孟

css方法:

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

js方法:在标签上添加

onselectstart="return false;"

在input textarea标签中无效。
这个方法是禁止内容被选中。

上一篇 下一篇

猜你喜欢

热点阅读