-webkit-tap-highlight-color is not working

16,980

Solution 1

use both:

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

OR

* {
    -webkit-touch-callout:none;                /* prevent callout to copy image, etc when tap to hold */
    -webkit-text-size-adjust:none;             /* prevent webkit from resizing text to fit */
    -webkit-tap-highlight-color:rgba(0,0,0,0); /* prevent tap highlight color / shadow */
    -webkit-user-select:none;                  /* prevent copy paste, to allow, change 'none' to 'text' */
}

Solution 2

I thought I'd add to the accepted answer...

Using cursor: pointer will also cause the tap highlight to persist (even after setting -webkit-tap-highlight-color). Make sure to remove it on the element or parent it's inheriting from.

Share:
16,980
Ashoka Mondal
Author by

Ashoka Mondal

Updated on July 03, 2022

Comments

  • Ashoka Mondal
    Ashoka Mondal almost 2 years

    I am trying to remove tap highlight color. But it is not working mobile. When i am trying to see using inspect element on pc it is also not showing.

    My css is

    button, button:hover, li:hover, a:hover , li , a , *:hover, *
    {
      -webkit-tap-highlight-color: rgba(0,0,0,0); 
    }
    

    is there any error on my css..