← Blog

Hide the annoying outline for mouse users but preserves it for keyboard users

WordPress1 min read

CSS that get’s rid of the annoying outline for mouse users but preserves it for keyboard users, and is ignored by browsers that don’t support :focus-visible.

:focus:not(:focus-visible) { outline: none }

Source @LeaVerou

Stuck on something like this?

I help businesses and agencies with WordPress, WooCommerce and JavaScript problems, from one-off fixes to ongoing support.