禁用围绕Android的链接橙色亮点橙色、亮点、链接、Android

2023-09-06 03:27:14 作者:十里故清欢

我已经尝试了千万次,以去除围绕在Android的WebView链接恼人的橙色突出显示框,但他们似乎并没有消失。不,这不工作:

I've tried a million times to remove the annoying orange highlight box around links on Android webview, but they don't seem to go away. And no, this does not work:

* {
    -webkit-tap-highlight-color:rgba(0,0,0,0) !important;
}

我真的很困惑在这里,任何其他的想法?我测试上的Galaxy S3。

I'm really perplexed here, any other ideas? I'm testing on Galaxy S3.

推荐答案

尝试

* {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-user-modify: read-write-plaintext-only;
}

从这里。原来,真正棘手的一点是,第二个属性,用户修改。我认为这是因为4.0.4的要求,这恰好影响银河S3,等等。

from here. Turns out the real tricky bit is that second property, user-modify. I think that's a requirement since 4.0.4, which happens to affect the Galaxy S3, among others.

您可以缩小选择的范围,但它影响到链接的父的,例如:一个< P> <李> ,而不是链接本身

You can narrow the scope of the selector, but it has to affect the parent of the link, e.g. a <p> or <li>, not the link itself.

 
精彩推荐