【发布时间】:2015-02-09 13:04:34
【问题描述】:
我的 CSS 有问题。在 Firefox 中我的图标下方有一个空白,但在 Chrome 中没有。我真的很困惑问题出在哪里。
Firefox 页脚截图:http://puu.sh/dqkrp/1ca27fd502.png
Chrome 页脚截图:http://puu.sh/dqkOw/ea7749b56c.png
<footer>
<div id="contact-bar">
...
</div>
</footer>
#contact-bar {
width:100%;
height:auto;
float:right;
margin-bottom: auto;
bottom: 0px;
background-color: #000000;
}
#contact-bar ul {
margin:auto;
display: inline-block;
list-style-type: none;
padding: auto;
float:right;
}
#contact-bar ul li{
float:right;
}
#contact-bar ul li a {
text-decoration: none;
}
footer {
position: fixed;
z-index: 9999;
clear:both;
bottom:0;
left:0;
width:100%;
margin:0px;
padding:0px;
}
【问题讨论】:
-
使用 Firefox 中的开发工具检查元素。当一切都失败时,使用 Normalize.css
-
或使用
*{margin:0; padding:0;} -
可能只是图像本身。默认情况下,图像是
display: inline和vertical-align: baseline。这会导致图像底部的间隙将图像父级向下推。如果这是造成间隙的原因,那么您可以使用#contact-bar img { display: block; }将它们设为块元素或使用#contact-bar img { vertical-align: middle; }更改默认垂直对齐方式。 -
使用一些 normalize.css 规范化你的 CSS
标签: html css google-chrome firefox