我已经搜索了很多类似的主题并尝试了很多方法,但仍无法解决此问题。页脚底部边界与图像底部边界之间存在不必要的空间。如果我将图像更改为显示:块,该空间将消失。但我无法解释这个问题是如何发生的?谢谢。由于新帐户,我无法显示任何图像。页脚和子图像之间不需要的空间
HTML:
<html>
<body>
<div id="wrapperMain">
<footer>
<img src="ico/square-facebook.svg"
/><img src="ico/square-twitter.svg"
/><img src="ico/square-google-plus.svg"/>
</footer>
</div>
</body>
</html>
CSS:
* {
margin:0;
padding:0;
}
html, body {
height:100%;
}
#wrapperMain {
position:relative;
min-height:100%;
}
footer {
position:absolute;
width:100%;
bottom:0;
background:#eeeeee;
text-align:center;
}
可以看到在这个空间http://i.imgur.com/nO6TJP7.jpg –
_“如果我改变图像要显示:块,该空间将消失。但是我无法解释这个问题是如何发生的?“ - 因为没有'display:block',图像与_line box_的(潜在)文本内容的_baseline_对齐。 – CBroe
谢谢。非常清楚。 –