当页面作为 Web 独立应用程序时,错误的 webkit-tap-highlight-color 行为

发布于 2025-01-03 13:50:46 字数 417 浏览 2 评论 0原文

我正在尝试使用 css 删除 iPad 中网页点击时的突出显示,

-webkit-tap-highlight-color: rgba(0, 0, 0, 0)

这在直接使用 iPad2 中的浏览器时效果非常好。但是,如果我将页面移动到带有漂亮大图标的网络应用程序,则该行为不再有效。怪人没有?

设置

document.documentElement.style.webkitTouchCallout = "none";

正如这个问题中指出的那样不起作用

一些想法,提示受到欢迎

I'm trying to remove the highlight on tap of a web page in the iPad with the css

-webkit-tap-highlight-color: rgba(0, 0, 0, 0)

This works great when using directly the browser in my iPad2. However if I move the page to a web app, with the a nice big icon, the behavior is not any longer working. Weirdo no ?

Setting

document.documentElement.style.webkitTouchCallout = "none";

as pointed in this question does not work

Some ideas, hints are welcomed

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

永不分离 2025-01-10 13:50:46

-webkit-tap-highlight-color-webkit-user-select 的组合对我有用。您可以将它们应用到单个元素或 html

html {
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none;
}

The combination of -webkit-tap-highlight-color and -webkit-user-select works for me. You can apply these to an individual element, or html.

html {
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文