开发者

Want to disable outline when clicking on element with link (can't get it working with Firefox)

开发者 https://www.devze.com 2022-12-18 11:46 出处:网络
So I want to disable the outline when clicking on a link, but I still want users to be able to tab through all links with a keyboard.Therefore, this fix should work

So I want to disable the outline when clicking on a link, but I still want users to be able to tab through all links with a keyboard. Therefore, this fix should work

a:active {
    outline: none; }

It works for all browsers except for Firefox. Any 开发者_开发百科suggestions?


If you are content with requiring your keyboard users to have JavaScript activated (I know, not perfect) you could give each link an outlined class onfocus, and remove it onblur.

For a more thorough approach, check out this blog entry that discusses removing the outline from a accessibility perspective.


a {outline:none;}

hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消