Remove white space below image [duplicate]

2018-12-31 05:21发布

This question already has an answer here:

In Firefox only my video thumbnails are displaying mysterious 2-3 pixels of white space between the bottom of my image and its border (see below).

I've tried everything I can think of in Firebug with no luck.

How can I remove this white space?

Screenshot displaying white space below image

9条回答
有味是清欢
2楼-- · 2018-12-31 05:55

You can use code below if you don't want to modify block mode:

img{vertical-align:text-bottom}

Or you can use following as Stuart suggests:

img{vertical-align:bottom}
查看更多
初与友歌
3楼-- · 2018-12-31 06:02
.youtube-thumb img {display:block;} or .youtube-thumb img {float:left;}
查看更多
浅入江南
4楼-- · 2018-12-31 06:05

You're seeing the space for descenders (the bits that hang off the bottom of 'y' and 'p') because img is an inline element by default. This removes the gap:

.youtube-thumb img { display: block; }
查看更多
登录 后发表回答