当您在适用于 iOS 的 Safari(或 chrome 或 firefox)中单击(触摸)链接时,链接后面会出现灰色背景(仅当您按住它时)。有没有办法使用 CSS 删除此功能?
请看下面的示例图片:
最佳答案
Webkit 有一个特定的样式属性:-webkit-tap-highlight-color
。
复制自:http://davidwalsh.name/mobile-highlight-color —
/* light blue at 80% opacity */
html {
-webkit-tap-highlight-color: rgba(201, 224, 253, 0.8);
}
/* change it for a div that has a similar background-color to the light blue tap color */
.blueDiv {
-webkit-tap-highlight-color: rgba(251, 185, 250, 0.9);
}
如果你想完全去除高亮——
.myButton {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
关于ios - 删除在 ios safari/chrome/firefox 中单击的链接上的灰色背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11885161/