此消息已被修改以适合您的屏幕。点按此处显示原件

This message has been modified to fit your screen. Tap here to show original

我制作了固定的电子邮件模板。但是当我尝试在 gmail 中的移动设备上测试它时(它只发生在 gmail 中)它破坏了我的布局(看起来它使我的布局适合设备宽度,就像在响应式电子邮件中一样)。有一条消息:"This message has been modified to fit your screen. Tap here to show original"。点击后看起来很完美,没有任何缺陷。有什么方法可以防止这种情况并在开头显示原始电子邮件吗?

如果您希望删除电子邮件的大小调整并将其保持在定义的(非响应比例),请将 <meta name="viewport" content="width=device-width, initial-scale=1"/> 添加到您的电子邮件中,这样应该可以防止调整大小。

如果您正在尝试让它使用媒体查询等。这不会发生,因为 gmail 应用程序完全剥离了样式标签,您必须构建为 hybrid 并首先从 Gmail 应用程序开始.

在跨越模板整个宽度的元素上放置内联样式。例如:<td style="min-width:600px;"></td>。这使 GMail 的自动调整大小 'feature' 不会影响布局的其余部分。

找到答案了。也许它可以帮助某人。要显示原始布局需要将此代码添加到电子邮件的末尾。

<tr>
<div style="display:none; white-space:nowrap; font:15px courier; line-height:0;">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</div>
</tr>

带有虚线的 white-space:nowrap 创建了一条约 500px 的线,当尺寸增大时将超过 700px,导致 Gmail 不应用字体更改。

display:none 样式导致非 Gmail 客户端隐藏块(Gmail 忽略 display:none)。例如,在非 Gmail 移动客户端中查看电子邮件时,不会影响响应式布局。