The Problem
On iOS, every tappable element — buttons, links, anything with a click handler — gets a brief translucent grey highlight when tapped. On standard blue links it's mostly unnoticeable, but on custom-styled buttons it looks like a dark flash or broken opacity animation.
Default grey flash on tap
Root Cause
WebKit applies a default -webkit-tap-highlight-color to all clickable elements via its User Agent stylesheet. The default value is a semi-transparent grey (rgba(0,0,0,0.18) approximately), which appears as a dark flash over the element on tap.
This is an intentional iOS UI convention — it provides visual feedback that a tap registered. But it ignores any custom :active or :focus styles you've set, creating a double-feedback problem with custom-designed components.
Fix — Remove the highlight, add your own :active
/* Step 1: Remove the default tap highlight globally */
* {
-webkit-tap-highlight-color: transparent;
}
/* Or target only interactive elements */
button,
a,
[role="button"],
[tabindex] {
-webkit-tap-highlight-color: transparent;
}
/* Step 2: Replace with your own :active feedback */
button:active {
opacity: 0.75;
transform: scale(0.98);
transition: transform 0.1s, opacity 0.1s;
}
a:active {
opacity: 0.7;
}:active opacity, background colour shift, or scale. Removing highlight with no replacement makes buttons feel unresponsive.Custom Highlight Colour
Instead of removing it entirely, you can set a custom colour — your brand's accent colour at low opacity makes tap feedback feel intentional rather than broken.
/* Brand-coloured tap feedback instead of grey */
button,
a {
-webkit-tap-highlight-color: rgba(10, 132, 255, 0.15);
}Browser Support
| Browser | Min Version | Status | Notes |
|---|---|---|---|
| Safari iOS | All | Partial | -webkit-tap-highlight-color: transparent removes the flash |
| Chrome iOS | All | Partial | Same WebKit engine — same behaviour and fix |
| Chrome Android | All | Partial | Has its own tap ripple — controlled separately |
| Firefox | All | Supported | No tap highlight by default |
| Safari macOS | All | Supported | No tap highlight (mouse-driven) |