【发布时间】:2025-12-17 17:35:08
【问题描述】:
我正在尝试创建一个 mailchimp 模板,但我遇到了与表格单元格中的背景图像的兼容性问题。
像这样的东西,只是被 Outlook 等忽略:
<td align="center" background="image-url.jpg" style="background-size: cover; background-position: center;">
我越来越接近做这样的事情:
<table class="wrapper" width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" background="image-url.jpg" style="background-size: cover; background-position: center;">
<div>
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;">
<v:fill type="tile" src="image-url.jpg" color="#7bceeb" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]-->
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr><td>Information etc</td></tr>
</table>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</div>
</td>
</tr>
</table>
我遇到的问题是图像是平铺的。有没有办法让它匹配
style="background-size: cover; background-position: center;"
造型? 此外,出于某种原因,它会将嵌套表推到左侧而不是中心。我认为是 div 可以做到这一点。
最后,这是最好的选择还是有更安全的方法来处理表格单元格中的背景图像?
谢谢。
【问题讨论】:
标签: html email templates styles mailchimp