Html 从图像锚点 IE 中删除蓝色轮廓/边框
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16178078/
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
Removing blue outline/border from image anchor IE
提问by Sidetik
To start off, I don't even know what this is.
I tried text-decoration: none
, border: none
, outline: 0
, and nothing seems to work?
My CSS file is working all right, so it's not that?
首先,我什至不知道这是什么。我试过text-decoration: none
, border: none
, outline: 0
,但似乎没有任何效果?我的 CSS 文件工作正常,所以不是这样吗?
Here's a picture: http://i38.tinypic.com/rbgv3k.jpg
这是一张图片:http: //i38.tinypic.com/rbgv3k.jpg
<div id="links">
<span id="user"><a id="link" href="register.php"><img src="images/user.png"/></a></span>
<span id="follow"><a id="link" href="https://twitter.com/itsybitsycom"><img src="images/follow.png"/></a></span>
<span id="about"><a id="link" href="about.html"><img src="images/about.png"/></a></span>
<span id="stats"><a id="link" href="profile.php"><img src="images/stats.png"/></a></span>
</div>
CSS
CSS
#link {
text-decoration:none;
border:0;
outline:none;
}
回答by Ejaz
try adding following to your CSS
尝试将以下内容添加到您的 CSS
img{ border:0 }
回答by David Storey
IE adds a border around images if they're the child of an anchor. You can remove this by setting the border to none:
如果图像是锚的孩子,IE 会在图像周围添加边框。您可以通过将边框设置为无来删除它:
a img {
border: none;
}
回答by Richard Guy
a{
outline: none !important;
}
Worked for me.
为我工作。
回答by Richard Guy
#link img a
{
border:0;
outline:none;
}
回答by Spudley
You need to add the CSS to the image, not to the link. Instead of #link
, you need to use #link img
as the selector.
您需要将 CSS 添加到图像中,而不是添加到链接中。而不是#link
,您需要#link img
用作选择器。
Then border:none;
should work for you.
那么border:none;
应该为你工作。
#link img {
border: none;
}
回答by tymeJV
You should be able to do it with this CSS:
你应该可以用这个 CSS 来做到这一点:
border-style: none;