Active state click works on desktop using the following CSS:
a.btn.btn-primary:focus {
background: green;
But tapping the buttons on IOS does not trigger the tap highlight colour. Any idea how to solve this? https://temp.impactwroughtiron.com.au/
Any help appreciated.
PS This post relates to the same issue found in this post: Adding active tap state to mobile
Unfortunately, swapping focus for hover doesn’t work on my iPhone ,but does on the desktop.
I copied the JavaScript from the link you supplied and dropped it into my footer.php but no luck there either. Check the green button on this site on your mobile - this is what I’m looking for, but with simple hover colour, no drop shadow.
I don’t know why my iPhone is not picking up hover. Could it be a cache issue? Any idea how to empty cache on iPhone?
Yes that’s how :hover works by default. There is nothing extra going on there.
It seems you have some sort of script or function that interferes with that behaviour. Try removing the skip-link.js file you have in the page and test to see if that’s the culprit. If no change then put it back in place.
You can also try adding an empty onclick handler to the button links as that is another fix which is usually used for non focusable elements.
e.g.
<a onclick="" class="btn" href="... etc
Yes it was not a straight copy and paste as you would need to set it all up correctly and apply the css that goes with it. The code was specific to my example but could be changed to suit your example by changing it to apply to the correct elements in your page.
e.g: here’s a working example with your phone links added.
Paul, I really appreciate your insight here. Having your code work on the site is reassuring, but I just can’t get the homepage to work. Something is interfering with the script as you say but I don’t know what it is or where to start looking.
I commented out all the script enqueues in functions.php and it made no difference to the site at all, so that’s not particularly encouraging… but, upward and onward!
Thanks for your help