When I click a link on my website it is creating an outline around the link like so
I've tried adding:
a.image-link:focus { outline: 0; }
and
a {outline : none;}
But nothing seems to get rid of it. Is there a way to remove it?
Using the CSS rule :focus { outline: none; } to remove an outline on an object causes the link or control to be focusable, but removes any visible indication of focus for keyboard users. Methods to remove it such as onfocus="blur()" result in keyboard users being unable to interact with the link or control.
Example of removing the focus around an HTML <a> tag: Here, we use the :focus pseudo-class on the <input> element and set both the outline and box-shadow properties to "none".
To remove focus around the button outline:none property is used. Outline property: Outline is an element property which draws a line around element but outside the border. It does not take space from the width of an element like border.
By setting the text-decoration to none to remove the underline from anchor tag. Syntax: text-decoration: none; Example 1: This example sets the text-decoration property to none.
You can just use this:
a:active, a:focus { outline: 0; border: none; -moz-outline-style: none; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With