【发布时间】:2015-08-20 22:32:42
【问题描述】:
谁能解释一下为什么在图像下方有这个黄色的小填充?我知道图片右边的黄色空间是正常的,但为什么在下面?知道如何解决这个问题吗?
谢谢!
HTML:
<body>
<div id="page">
<div class="box">
<div class="info" style="background:yellow">
<img src="https://placehold.it/350x150" style="max-width:100%;height:auto">
</div>
<div class="info">Text</div>
</div>
<footer>Footer</footer>
</div>
</body>
CSS:
body{margin:0;font-size:100%}
#page{margin: 0 auto}
footer{background:black;color:white}
.box {background:white}
.info {background:orange}
@media screen and (min-width:480px) {
.box {width:100%;float:left}
.info {width:50%;float:left}
}
【问题讨论】:
-
不是填充。它是为descenders 提供空间的浏览器。这是我解释其工作原理的答案:Mystery white space underneath image tag
标签: css