表中的html图像没有空格 [英] html images in table with no space

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

问题描述

我有一个html表,我将图像并排放在td中。我怎样才能得到它,以便每张图像之间根本没有空间?默认情况下,尽管每个表元素上有0个填充和边距,但所有浏览器似乎都放入了一个小空间。我没有在td上指定宽度,所以默认情况下它占用了图像内部的宽度。

I have an html table in which I am placing images side by side inside the td's. How can I get it so that there is no space at all between each image? By default all browsers seem to put in a small space despite 0 padding and margin on each table element. I am not specifying a width on the td's so by default it takes up the width of the image inside of it.

ie:

<table>
  <tr>
    <td><img ... /></td> //no space between the td's
    <td><img ... /></td>
  </tr>
</table>


推荐答案

申请此css:

td, tr, img  { padding: 0px; margin: 0px; border: none; }
table { border-collapse: collapse; }

这会将所有空格重置为0.

This resets all spaces to 0.

这篇关于表中的html图像没有空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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