Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Iphone darkens div on click

When you have a div with a click handler attached, the iphone darkens the div as a click indicator, when the div is clicked.

Example: view on mobile safari http://jsbin.com/awejo3/4

My question is, how do I turn this behavior off? This is probably useful for most iphone users, but in some types of rich media applications, this is bad.

Thanks.

like image 438
Mark Avatar asked Feb 28 '23 11:02

Mark


1 Answers

You can set the "tap hightlight color" to transparent in css.

html
{
  -webkit-tap-highlight-color:transparent;
}
like image 86
joshrl Avatar answered Mar 15 '23 09:03

joshrl