图像标签下方的神秘空白 [英] Mystery white space underneath image tag

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

问题描述

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

解决方案

默认情况下,IMG 是一个内联元素.您需要将您的 IMG 标签设置为块元素,可以通过这种样式来完成:

显示:块;

I just changed the header image on my site from

<div style="background-image... width=1980 height=350>

to using

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

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

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

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.

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

解决方案

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天全站免登陆