Wednesday, August 17, 2011

Remove the rectangle display when the user taps a link or a JavaScript clickable element in Safari on iPhone.

Description

Overrides the highlight color shown when the user taps a link or a JavaScript clickable element in Safari on iPhone.

This property obeys the alpha value, if specified. If you don’t specify an alpha value, Safari on iPhone applies a default alpha value to the color. To disable tap highlighting, set the alpha value to 0 (invisible). If you set the alpha value to 1.0 (opaque), the element is not visible when tapped.

Syntax

-webkit-tap-highlight-color: color;

Example

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