最小化 html 个表格的样式

Minimize styling for html tables

我正在处理 HTML 电子邮件并面临一个问题,我在 部分定义了样式标签。 Outlook 会以所需的样式显示此电子邮件,但 Gmail 不会。这是因为 Gmail 的预处理器删除了部分中包含的样式。 内联样式似乎是与 Gmail 一起使用的唯一选项,但它是负担不起的,因为我需要应用 css 样式并且我有大约 9000 table 行,6-7 列。因此,如果我使用可能超过电子邮件客户端大小限制的内联样式,则会生成一堆额外的文本。有没有办法弄清楚我们如何才能同时实现这两个目标,即不超过大小以及在 Gmail 中正确呈现消息。

内联样式是 Gmail 的唯一选项。

看这里:https://www.campaignmonitor.com/css/

这也是一个很好的资源:https://litmus.com/blog/understanding-gmail-and-css-part-1

如此处所述:

Commonly stripped elements include JavaScript, object and embed tags, and Flash. Gmail goes one step further and strips out both the head and body tags, as well as any style tags in an email.

和:

The quickest way to insure your email campaign renders properly in Gmail is to place your most important styles inline.