How do I remove outline on link click?

别来无恙 提交于 2019-12-14 03:39:51

问题


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?


回答1:


You can just use this:

a:active, a:focus {
  outline: 0;
  border: none;
  -moz-outline-style: none;
}



回答2:


Simply add outline:none; text-decoration:none;




回答3:


Just add a:visited { outline: none; } in your style file.




回答4:


Fixed:

Found out in my CSS that there was code already being generated to create an outline on a:active. This was overriding my code and removing it fixed the problem.



来源:https://stackoverflow.com/questions/34635588/how-do-i-remove-outline-on-link-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!