« Yet another free GeocoderToyota Yaris radio security code unlock instructions »

Disabling highlight on touch in iOS mobile safari web apps

Technical, Android, iPhone, 104 words   Bookmark and Share

When building web apps for mobile devices such as mobile Safari on iOS and the web browser on Android devices. When implementing web apps, by default any touch events causes a tint sort of highlight on any anchor elements or DOM elements with click events. On Android particularly HTC sense, it creates a green border.

To disable this, you use the webkit CSS attribute -webkit-tap-highlight-color

This overrides the highlight color shown when the user taps a link or a JavaScript clickable element.

Syntax

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

Note, you’ll need to set the above colour with alpha channel as 0 in order to disable the touch highlight

November 2024
Mon Tue Wed Thu Fri Sat Sun
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
 << <   > >>
Brinley Ang

Brinley Ang is a software engineer, sysadmin, coder, geek boy, jedi knight fragger, caffine addict, deaf meloncholic and rockstar wannabe. Listens to the sex pistols and a wide assortment of heavy metal.

Make payments with PayPal - it's fast, free and secure!
Search
home | portfolio | blog | links | contact
© 2024 - Brinley Ang
Valid xhtml