我刚刚更改了我网站上的标题图片
使用
所以图像会像现在一样缩小......
但现在我有这个神秘的 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;
更多推荐
图像标签下方的神秘空白
发布评论