Html 如何删除链接点击时的轮廓?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34635588/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I remove outline on link click?
提问by SaturnsEye
回答by Nuno Bentes
You can just use this:
你可以使用这个:
a:active, a:focus {
outline: 0;
border: none;
-moz-outline-style: none;
}
回答by Rajeev Raushan Prasad
Just add a:visited { outline: none; }
in your style file.
只需添加a:visited { outline: none; }
您的样式文件。
回答by Pullat Junaid
Simply add outline:none; text-decoration:none;
只需添加轮廓:无;文字装饰:无;
回答by Vijayendra Shah
If at-least one of the solutions above doesn't work for anyone. Give this a try as well
如果至少上述解决方案之一对任何人都不起作用。也试试这个
a:active, a:focus {
box-shadow: none;
}
回答by SaturnsEye
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.
在我的 CSS 中发现已经生成了用于在a:active
. 这是覆盖我的代码并删除它解决了问题。
回答by IsleBeeGun
When you are dealing with a bunch of frameworks/modules, there could be multiple layers of divs - not all of them are reachable via class names.
当您处理一堆框架/模块时,可能会有多个 div 层 - 并非所有层都可以通过类名访问。
This bomb works for me:
这个炸弹对我有用:
*:focus {
outline-width: 0px !important;
}