用户选择:无导致输入字段在Safari上无法访问 [英] User select:none causes input field to be inaccessible on Safari

查看:149
本文介绍了用户选择:无导致输入字段在Safari上无法访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用这些CSS样式,我可以防止在页面上突出显示的文本选择。但这会导致输入字段在Safari上被用户输入锁定。

  * {
-webkit-touch-标注:无;
-webkit-user-select:none; //锁定Safari上的字段
-khtml-user-select:none; //锁定Safari
上的字段-moz-user-select:none;
-ms-user-select:none;
user-select:none;

$ / code>

Safari有没有阻止用户选择而不干扰输入字段的方法?

解决方案

为什么不把样式应用于除了输入之外的所有内容?

css3 way:
*:not(input){...}


With these css styles I prevent the highlighted text selection on a page. But this causes the input fields to be locked from user input on Safari.

* {
-webkit-touch-callout: none;
-webkit-user-select: none; // locks fields on Safari
-khtml-user-select: none; // locks fields on Safari
-moz-user-select: none;
-ms-user-select: none;
user-select: none;      
}

Is there a way on Safari to prevent user selection without interfering with input fields?

解决方案

Why not just apply the style to everything but the inputs?

css3 way: *:not(input){...}

这篇关于用户选择:无导致输入字段在Safari上无法访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆