我如何摆脱< img> html页面中的行中的元素? [英] How do I get rid of the space between <img> elements in a row in a html page?

查看:95
本文介绍了我如何摆脱< img> html页面中的行中的元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我像这样连续显示3 < img>

I'm displaying 3 <img> in a row like this:

<div style="width: 950px">

                <img src='/UploadedImages/86.jpg' alt='' style="width: 300px; margin: 0px; padding: 0px; border: 1px solid Black" />

                <img src='/UploadedImages/85.jpg' alt='' style="width: 300px; margin: 0px; padding: 0px; border: 1px solid Black" />

                <img src='/UploadedImages/84.gif' alt='' style="width: 300px; margin: 0px; padding: 0px; border: 1px solid Black" />

        </div>

正如您所看到的,我在图像周围留有细小的黑色边框。我的问题是在相邻图像的边界之间存在大约5px宽的空白区域,我已将边距设置为0px,但不起作用。那么这里发生了什么?

As you can see I have thin black borders around the images. My problem is that there are white spaces about 5px wide between the borders of neighbouring images and I have set the margin to be 0px but it does not work. So what is happening here?

推荐答案

您必须移除标记之间的空格(换行符和空格):

You have to remove the whitespaces (linebreaks & spaces) between the tags:

<img src='/UploadedImages/86.jpg' alt='' style="..." /><img src='/UploadedImages/85.jpg' alt='' style="..." />

或发表评论以保持换行:

or make comments to keep linebreaks:

<img src='/UploadedImages/86.jpg' alt='' style="..." /><!--

--><img src='/UploadedImages/85.jpg' alt='' style="..." />

这篇关于我如何摆脱&lt; img&gt; html页面中的行中的元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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