为什么我的图片有额外的间距? [英] Why have my images got extra spacing?

查看:100
本文介绍了为什么我的图片有额外的间距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我什么是造成图像下方的空间?似乎有额外的填充在divs与红色边框相关的图像。我不能找到这个间距在firebug。

Can anyone tell me what is causing the space below the images? There seems to be extra padding in the divs with the red border relating to the images. I cant find this spacing in firebug at all.

Baffled。

alt text http://antony.co.za/so.jpg

推荐答案

默认情况下,图像将其底部边缘与文本的基线对齐。你看到的空间是基线下面的空间,由诸如q,p,y等递归使用。(没有文本的事实是不相关的 - 它们的空间仍然保留。)

By default, images align their bottom edges with the baseline of the text. That space you're seeing is the space below the baseline, used by decenders like q, p, y, etc. (The fact that you have no text is irrelevant - space for them is still reserved.)

你可以这样摆脱它:

img {  /* Or a suitable class, etc. */
    vertical-align: bottom;
}

这篇关于为什么我的图片有额外的间距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆