在图象标记下的神秘白色空间 [英] Mystery white space underneath image tag

查看:115
本文介绍了在图象标记下的神秘白色空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚更改了我网站上的标题图片

I just changed the header image on my site from

< div style =background-image ... width = = 350>

使用

img src =... style =width:100%;>

因此图片会缩小...

so the image would scale down which it now does...

但现在我有这个神秘的10px差距。

But now I have this mysterious 10px gap or so.

在Chrome中,我只是看不到造成空间的原因。我已搜索其他帖子,但找不到任何适用的内容。

I've checked the inspector in Chrome, and I just can't see what's causing the space. I've searched other posts but can't find anything that applies.

有人有任何想法吗?赞同任何帮助,Bob:)

Anyone out there have any idea? Appreciate any help, Bob :)

推荐答案

默认情况下,IMG是一个内联元素。您需要将IMG标记设置为块元素,可以使用以下样式完成:

By default, IMG is an inline element. You need to set your IMG tag to be a block element, which can be accomplished with this style:

display: block;

这篇关于在图象标记下的神秘白色空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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