html - 绝对定位图像之间的黑线

标签 html css

我有这个 fiddle :http://jsfiddle.net/wtw7ebkr/1/

HTML:

<div id="navsocial">
    <a href="https://www.facebook.com/" target="_blank">
        <img src="http://i.imgur.com/gIVEWHc.png" />
    </a>
    <a href="https://twitter.com/" target="_blank">
        <img src="http://i.imgur.com/sUEWyjj.png" />
    </a>
    <a href="https://plus.google.com/" target="_blank">
        <img src="http://i.imgur.com/GT4Unbz.png" />
    </a>
</div>

CSS:

#navsocial {
    position: absolute;
    right: 20px;
    top: 5px;
}

#navsocial img {
    width: 40px;
    height: 40px;
}

在 chrome 和 firefox 下,它在 facebook 和 twitter 以及 twitter 和 gplus 图标之间显示 2 条黑线。

  1. 为什么会有这些线?

  2. 我怎样才能摆脱它们?

我看到的截图:http://i.imgur.com/xDKMmxc.png

最佳答案

之所以有这些线,是因为超链接 anchor 在 HTML 中由 a 表示,默认情况下带有下划线

您需要将 text-decoration: none; 应用到 a anchor

#navsocial a {
    text-decoration: none;
}

Fiddle

关于html - 绝对定位图像之间的黑线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26633556/

相关文章:

javascript - 按钮点击只有效一次

iphone - 创建一个将用户重定向到移动/HTML5 网站的 iPhone 应用程序

javascript - 单击按钮时如何将 for-each 循环中的文本复制到剪贴板?

html - 无法让简单的 html5 list 缓存工作!

jquery - 结合 jQuery Mosaic 与 CSS3 box-shadow 页面 curl 效果

css嵌套类,如何不重复代码?

jquery - 仅显示图像的选择 + 'hover move around effect'

javascript - 调整窗口大小时,页脚会压缩

jquery隐藏li的父ul中的ul元素

html - 我的 css 导入失败