7 回答
不幸的是,我认为这hideFocus
是你最好的答案,因为模糊并不总是合适的:
<a href="..." hidefocus="hidefocus">...</a>
http://msdn.microsoft.com/en-us/library/ms533783(VS.85).aspx
听起来您正在谈论通过链接进行选项卡时出现的虚线边框。您有 Firefox 的正确解决方案(大纲:CSS 中没有)。我用于 IE 的最佳解决方案是添加一个取消焦点的 onfocus 侦听器:
<a href="" onfocus="this.hideFocus=true;">link</a>
看看这个网站,看看你如何在全球范围内做到这一点:http: //codylindley.com/Javascript/223/hiding-the-browsers-focus-borders-should-i-shouldnt-i
除非我错过了正在讨论的虚线边框,否则 outline:none 在 Internet Explorer 8 中有效(至少对我而言)。而是突然之间,一些超链接以虚线边框呈现(我记得唯一更改的属性是 display:inline 在包含链接的 h2 元素上,然后出现虚线边框)。所以我扔了一个{大纲:无;在我的全局样式表和 poof 中,IE8 中不再有边框!
对于 IE,您可以像这样使用 Javascript:
<a href="..." onfocus="this.blur();">Click Here</a>
阅读更多: http ://www.htmlgoodies.com/beyond/javascript/article.php/3471171
对于 Firefox 和 Safari,outline:none 有效。
a {outline:noneIE 8}
css 似乎在 Firefox、Chrome 和 IE 8 上运行良好。
这不起作用吗?
a
{
border: 0;
}
a {
outline: 0 none !important;
border: none;
}