在 Chrome 移动设备上发生触摸时如何禁用蓝色边界框?

时间:2020-12-30 02:05:14

标签: html css

我想在我的 Web 应用程序上去掉用于触摸视觉反馈的蓝色矩形。在圆形按钮上总是很不愉快。

enter image description here

上面的按钮有一个 css 使它圆润和一个活动状态颜色。我不需要原生 chrome 移动视觉反馈。

我还注意到这种行为在使用引导程序时不会发生,但在使用 Bulma 或 Tailwind 时会发生。

如何在我的移动网站中禁用此功能?

1 个答案:

答案 0 :(得分:6)

您必须设置 -webkit-tap-highlight-color:transparent-webkit-tap-highlight-color:rgba(0,0,0,0) > 删除 chrome 上默认的高光点按颜色。

https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-tap-highlight-color

关于 bootstrap,默认的 css 包含属性,你可以在这里看到: enter image description here