图像标签下方的神秘空白

编程入门 行业动态 更新时间:2024-10-23 22:33:24
本文介绍了图像标签下方的神秘空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

使用

所以图像会像现在一样缩小......

但现在我有这个神秘的 10 像素左右的差距.

我已经检查了 Chrome 中的检查器,但我看不出是什么导致了这个空间.我搜索了其他帖子,但找不到任何适用的内容.

有人知道吗?感谢任何帮助,鲍勃 :)

解决方案

默认情况下,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;

更多推荐

图像标签下方的神秘空白

本文发布于:2023-11-13 00:55:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582967.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   空白   神秘   标签

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!