Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 禁用文本输入元素上的用户选择_Css_Sass - Fatal编程技术网

Css 禁用文本输入元素上的用户选择

Css 禁用文本输入元素上的用户选择,css,sass,Css,Sass,我这里有点奇怪,我试图阻止用户在文本输入中突出显示文本,但下面的标准代码不起作用 -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; jsfiddle说明了这个问题- 在浏览器中检查css时,“user select:none;”处于活动状态,但没有任何区别,我的css中是否有其他内容覆盖了此行为?我甚至

我这里有点奇怪,我试图阻止用户在文本输入中突出显示文本,但下面的标准代码不起作用

-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
jsfiddle说明了这个问题-

在浏览器中检查css时,“user select:none;”处于活动状态,但没有任何区别,我的css中是否有其他内容覆盖了此行为?我甚至尝试将上述代码添加到特定的输入中,但没有结果

编辑:添加

pointer-events: none;
不是选项,因为输入会触发悬停效果和jQuery事件。

尝试使用

pointer-events: none;

在Css中,这就可以了,但我需要为Css将指针事件设置为“自动”:悬停事件和鼠标向下/mouseover jQuery事件类似于此属性的操作在
表单
元素(如输入、选择、文本区域…)上不起作用。。。。