【发布时间】:2013-05-25 11:29:49
【问题描述】:
如何删除或不显示每个带有图像的锚点中的边框链接?顺便说一句,浏览器设置处于兼容模式。其他问题的答案不足以解决我的问题。我猜是因为它只适用于较低版本的 IE。
编辑:
我目前正在我的客户需要我的地方创建自定义共享按钮。
<div>
<a onClick="window.open('https://twitter.com/intent/tweet?original_referer=#shareLink#&text=#shareTitle#&tw_p=tweetbutton&url=#shareLink#','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">
<img height="20" src="/images/chicklets/Twitter_Tweet.png" />
</a>
</div>
<div>
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=#shareTitle#&p[summary]=#shareDesc#&p[url]=#shareLink#&p[images][0]=images/Telos.jpg','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">
<img height="20" src="/images/chicklets/FaceBook_Share.png">
</a>
</div>
<div>
<a onClick="window.open('http://www.linkedin.com/shareArticle?mini=true&url=#shareLink#&title=#shareTitle#&summary=#shareDesc#','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">
<img height="20" src="/images/chicklets/LinkedIn_Share.png">
</a>
</div>
<div>
<a onClick="window.open('https://plus.google.com/share?url=#shareLink#','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">
<img height="20" src="/images/chicklets/Google_PlusOne.png">
</a>
</div>
CSS:
a {
outline : none;
text-decoration: none;
}
a img {
outline : none;
}
img {
border : 0;
border-style: none;
}
div {
float: left;
padding-right: 10px;
}
这是 IE10 的样子:
【问题讨论】:
-
您是否尝试将
border="0"或CSS 中的border: none添加到<img>?它适用于所有版本的 IE。 -
是的,我已经提出了这些建议,但没有一个能解决我的问题。 :(
-
仅将其添加到
img可能还不够,请在 CSS 中尝试a img {border: none}。您可能还需要通过添加!important来强调它 -
我已经用我的 CSS
a {outline : none !important;} a img {outline : none !important;} img {border : 0 !important;}添加了这些。没有什么变化。这有问题吗? -
不正确的 HTML 。你混淆了 HTML 和 CSS 语法:
<img height="20px"。如果我是你,我会用 Fiddler 或类似的工具检查 CSS 以找出谁给了你边框
标签: html css cross-browser hyperlink internet-explorer-10