treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Remove Gray Highlight When Tapping Links in Mobile Safari

Last updated on:

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

And then to allow :active styles to work in your CSS on a page in Mobile Safari:

document.addEventListener("touchstart", function(){}, true);
View Comments

Comments

  1. It might not be obvious to everyone, but this also works for Android default browsers as well, since they are also Webkit-based.

  2. Permalink to comment#

    works great on object tag, thx !

  3. Mudaser
    Permalink to comment#

    Awesome.!! many many thanks!!

  4. bilelz
    Permalink to comment#

    work great
    thanks

Leave a Comment

Use markdown or basic HTML and be nice.