响应式电子邮件模板

Responsive email template

我正在处理一个电子邮件模板,我想在其中为桌面设备创建 three columns grid structure 并为移动设备创建 single column structure,我不想使用媒体查询,因为它不是android 设备支持。有什么办法可以实现吗?

安舒尔, 只要您使用 table 堆叠而不是 TD 堆叠,Android 就支持媒体查询。更多相关信息:https://www.emailonacid.com/blog/article/email-development/how_android_is_strangling_responsive_design

你的另一个选择是使用流体混合设计:http://webdesign.tutsplus.com/tutorials/creating-a-future-proof-responsive-email-without-media-queries--cms-23919

您可以查看混合电子邮件模板。您可以查看 demo here or get the example source code

此方法使用 ghost table 修复了 Outlook 桌面中的列问题。

正如其他人所提到的,您应该研究使用 min/max-widths 而不是 hybridspongy 电子邮件设计方法重新配置布局的媒体查询。

我编写并维护了 Cerberus templatesHybrid 实现了您的要求。

This template uses a hybrid approach to reconfigure the layout for different screen sizes for email clients regardless of media query support. At its core, it uses max-width and min-width to impose rigid baselines (allowing some movement) and imposes a fixed, wide width for Outlook who is shackled to desktop anyway. Once a mobile-friendly baseline is set, media queries progressively enhance the email further in clients that support it.

此代码主要基于 Fabio Carneiro's hybrid code. His code contains a (relatively) simple 3 column fluid scaffold,您可能会有所帮助。