gpt4 book ai didi

HTML 电子邮件 - Firefox 和 PC 上的 hotmail 中单元格中的额外填充

转载 作者:太空宇宙 更新时间:2023-11-04 15:23:19 24 4
gpt4 key购买 nike

我正在尝试设置 HTML 电子邮件的样式,显然是使用表格和内联样式。我正在使用 litmus .com 进行测试

除了 2 个客户端 - Firefox 上的 Hotmail 和 Gmail 之外,我得到了相当不错的一致结果。

我在单元格中嵌入了一个表格,这是嵌入表格的 html -

<table border="0" align="center" cellpadding="0" cellspacing="0" style="padding:0px;">  
<tr>
<td colspan="3" valign="bottom" style="font-size:0px; padding:0px; margin:0px; vertical-align:bottom;overflow:hidden; "><img src="/images/promo-border-top.jpg" width="221" height="4"></td>

<td rowspan="4" style="padding-left:20px; ">
<a href=""><img name="template_r8_c2" src="/images/shop-now-eng.png" width="118" height="32" border="0" id="template_r8_c2" alt="shop now" /></a>
</td>
</tr>
<tr>
<td align="left" height="24" style="padding:0px; margin:0px; height:24px; background-image:url(/images/promo-border-left.jpg);background-repeat:repeat-y; background-position:left; overflow:hidden;" ><img src="/images/promo-border-left.jpg" width="4" height="24"></td>
<td align="center" valign="middle" height="20" style="padding:0px; height:20px; overflow:hidden; line-height:10px; font-family: arial, helvetica; color: #333333; font-size:12px margin-bottom:1px;">xxx-xxx-xxx-xxx</td>
<td align="right" height="24" style="padding:0px; margin:0px; height:24px; background-image:url(/images/promo-border-right.jpg); background-repeat:repeat-y; background-position:right;"><img src="/images/promo-border-right.jpg" width="4" height="24"></td>
<tr>
<td colspan="3" valign="top" style="padding:0px; font-size:0px; margin:0px; height:4px; background-color:yellow;overflow:hidden;"><img src="images/promo-border-bottom.jpg" width="221" height="4"></td>
</table>

我在下面放了两张图片,说明它是如何渲染的——忽略黄色部分,这是为测试而添加的。

This is how it should look, and how it looks across most clients

This is how it looks in hotmail and gmail

最佳答案

尝试将 display:block 添加到您的图像中。 GMail likes to add a little margin to images显示为 inline,默认值。

编辑:根据下面的评论:看起来有一个 tdrowspan 为 4,而您的 table 中只有 3 个可能的行>。如果将 4 改为 3 会怎样?

关于HTML 电子邮件 - Firefox 和 PC 上的 hotmail 中单元格中的额外填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6137593/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com