【发布时间】:2021-08-24 16:06:34
【问题描述】:
我目前正在制作带有表格的电子邮件布局,我需要的是能够将图片放在某些特定屏幕尺寸的文本上方
这是我的代码示例:
<table width="100%" cellpadding="0" cellspacing="0" style="border-spacing:0; padding: 50px 20px 10px;">
<tr>
<td valign="center" style="text-align:left;">
<h1 style="margin-top: -30px; margin-left: 10px; font-family: 'Trebuchet MS', sans-serif; font-size: 16px; color: #404040; line-height: 1.4; font-weight: 700">my text</h1>
<h1 style="margin-top: -10px; margin-bottom: 30px; margin-left: 10px; font-family: 'Trebuchet MS', sans-serif; font-size: 16px; color: #404040; line-height: 1.4; font-weight: 400">my text</h1>
</td>
<td valign="center" style="text-align:left;">
<img style="margin-right: 10px; margin-top: -50px;" src="https://via.placeholder.com/300.jpg" alt="">
</td>
</tr>
</table>
所以问题是从计算机屏幕查看图片时,图片必须与文本在同一行,而从移动邮件客户端查看时,图片必须位于文本上方/下方
【问题讨论】:
-
Flexbox 的支持仍然很差。不到 85% 的人实际上支持它。 Windows 根本不支持它。如果您可以添加预期布局的绘图,我们可以帮助您使用表格来完成。
标签: html css html-email