在锚标记的底部空白在锚标记的底部空白(White space at bottom of anchor

2019-05-10 15:14发布

我周围的图像的标签。 我有该标签是在div边框集。我都margin和padding设置为0,但由于某种原因,我的标签仍然比我的形象高约3个像素。 这使得一个位的形象和边界,这破坏了我要完成的外观之间的空间。

我究竟做错了什么? 我已经在Firefox和Chrome浏览器测试了相同的结果。 谢谢

Answer 1:

该图像是display: inline ,以便将被处理像字符和坐在基线。 的间隙被设置为所述下降(你像Ĵ,G,Y和P的信找到)的空间造成的。

调整vertical-align与CSS: img{vertical-align: bottom}



Answer 2:

display:block是足够的,如果元件没有兄弟姐妹。



文章来源: White space at bottom of anchor tag
标签: html css xhtml