无法在表格中的两个图像之间删除5px间隙

时间:2012-12-05 19:52:29

标签: html css html-email

我似乎无法将这两个图像直接放在一起。它们都在HTML表格中有自己的行(我正在制作一个html电子邮件),但我似乎无法删除它们之间的5px。

这是我的代码

<table width="200" height="200" cellpadding="0" cellspacing="0" border="0" style="border-    spacing: 0; border-collapse: collapse;border-collapse: seperate;">
<tbody>
<tr>
<td width="100" height="100"><img width="100" height="100" src="https://img.createsend1.com/img/templatebuilder/placeholder-image.png" /></td>
</tr>
<tr>
<td width="100" height="100"><img width="100" height="100" src="https://img.createsend1.com/img/templatebuilder/placeholder-image.png" /> </td>
</tr>
</tbody>
</table>​

如果有帮助的话,它也在jsfiddle

2 个答案:

答案 0 :(得分:3)

将图像设置为vertical-align: top。默认情况下,它们是baseline,在图像下方留出空间低于基线的文本中的字符。几乎除了baseline之外的任何其他值都应该起作用(底部,中间等)。

img{
  vertical-align: top;   
}

http://jsfiddle.net/JpdQ2/2/

答案 1 :(得分:2)

或者,将图像设置为display: block。由于垂直对齐,内联图像始终存在间距问题。

http://jsfiddle.net/JpdQ2/3/