当你在iOS的Safari(或Chrome或Firefox)中点击(touch )一个链接时,你会在链接后面看到一个灰色的背景(只有当你拿着它的时候).有没有办法使用CSS删除此功能?
请看下面的示例图片:
当你在iOS的Safari(或Chrome或Firefox)中点击(touch )一个链接时,你会在链接后面看到一个灰色的背景(只有当你拿着它的时候).有没有办法使用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);
}