25

When you click a link in the Android browser, the target link area gets highlighted with an orange box by default. A longpress then opens up the context menu for link handling (copy, paste, new window, etc). Is there a way to disable either / both of these in webview? I'm using the highlight code in scriptaculous and the default android link styling is being laid over top of the effect.

binaryorganic
  • 1,554
  • 4
  • 17
  • 25

2 Answers2

33

This might be useful: How to Hide Android WebView Highlight Border

The answer being: add this CSS * { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }.

Hopefully it is.

Dheeraj Bhaskar
  • 18,633
  • 9
  • 63
  • 66
I82Much
  • 26,901
  • 13
  • 88
  • 119
  • 1
    Exactly right! Thanks so much. I'm pasting the CSS here just in case that site ever disappears. * {-webkit-tap-highlight-color: rgba(0, 0, 0, 0);} – binaryorganic Aug 03 '10 at 18:33
  • 1
    @EnthuDeveloper it is css - so either in the css file for your page or in a style tag on the page itself. – Mr Zorn Jan 15 '12 at 23:43
11

The suggested solution sets the color as transparent black:

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

Simply specifying the color as transparent should work:

* {
  -webkit-tap-highlight-color: transparent;
}
Beau Smith
  • 33,433
  • 13
  • 94
  • 101
  • 1
    Just tested it (android 2.3.4), it doesn't. You cannot change the highlighting color, only make it disappear. And to do so, you must use rgba(X,X,X,0) syntax. – pcans Aug 29 '11 at 15:36