Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-webkit-tap-highlight-color is not working

Tags:

html

css

mobile

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..

like image 721
Ashoka Mondal Avatar asked Dec 31 '13 06:12

Ashoka Mondal


People also ask

Is not Working meaning?

If something "is not working", it's broken or ineffective right now. But that might be a temporary situation.

Is it work or is it working?

In which case, the difference in meaning would be that, “Is it working?” is a question that involves what it is doing right now. And, “Does it work?” is asking if it has recently worked and if you are confident that it will work again in the future.

Does not work or dont work?

Don't is a contraction of do not, while doesn't is a contraction of does not, and they both act as auxiliary verbs. In English, don't is used when speaking in the first and second person plural and singular and the third person plural ("I," "you," "we," and "they").

Did not work out meaning?

intransitive to be successful, or to end in a particular way. If it doesn't work out, you can always come back here.


2 Answers

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' */
}
like image 127
Sajad Karuthedath Avatar answered Nov 13 '22 23:11

Sajad Karuthedath


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.

like image 36
prograhammer Avatar answered Nov 14 '22 00:11

prograhammer