Monday, February 24, 2020

CSS Code to Remove Grey Highlight when Tapping Links in Webkit Browsers

Use the code below to avoid highlight when tapping links in the Webkit Browsers from Touch Device.

/* Essentially means a[href], or that the link actually goes somewhere */
*:link {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
*:visited {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
*:hover {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
*:active {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}

No comments:

Post a Comment