简体   繁体   English

HTML响应式电子邮件:台式机/平板电脑的3列布局到电话的2列布局

[英]HTML Responsive Email: 3 column layout for desktop/tablet to 2 column layout for phone

Trying to create a responsive HTML email that has a 3 column (multiple rows) layout for desktop/tablet and changes to 2 columns (multiple rows) for phone display using tables( <table> <tr> <td> ). 尝试创建具有响应性的HTML电子邮件,该电子邮件具有用于桌面/平板电脑的3列(多行)布局,并更改为使用表格( <table> <tr> <td> )用于电话显示的2列(多行)。 I've only found solutions online that go from a large device multi-column layout to a single column small device layout using mainly tables. 我只在线找到了从大型设备的多列布局到主要使用表的单列小型设备布局的解决方案。 What is the best strategy on how to code this type of layout? 如何编码这种布局的最佳策略是什么? I've tried referencing resources mainly from Mailchimp, Campaign Monitor and Litmus. 我尝试引用主要来自Mailchimp,Campaign Monitor和Litmus的资源。

The code below goes from 3 columns (large display) to 1 column (phone display) 下面的代码从3列(大屏幕)到1列(电话屏幕)

Link to code: https://github.com/alexwang949/html-responsive-email/blob/master/tables.html 链接到代码: https : //github.com/alexwang949/html-sensitive-email/blob/master/tables.html

The approach you'd likely need to take is what's becoming known as the "hybrid" email build. 您可能需要采用的方法就是所谓的“混合”电子邮件构建。

The basic idea is to build for mobile first, as Android's increasingly popular Gmail client does not support the style tag (and thus media queries) at all. 基本思想是先为移动设备构建,因为Android越来越流行的Gmail客户端根本不支持样式标签(因此也不支持媒体查询)。 Then, use widely-supported modern CSS to build the columns for webmail clients, Thunderbird and Apple clients. 然后,使用广泛支持的现代CSS为Webmail客户端,Thunderbird和Apple客户端构建列。 Finally, use Outlook-specific comments to create "ghost columns" (for example) to whip Outlook clients into shape. 最后,使用特定于Outlook的注释来创建“重影列”(例如),以使Outlook客户端处于良好状态。 Note: this step only works if your email provider doesn't strip out comments on send. 注意:仅当您的电子邮件提供商没有在发送中删除注释时,此步骤才有效。

It's a time-consuming process requiring some strategy, but ultimately this layered approach will yield results, which is the name of the email game. 这是一个耗时的过程,需要一些策略,但是最终,这种分层方法将产生结果,这就是电子邮件游戏的名称。

There's a fantastic article about this here: http://webdesign.tutsplus.com/tutorials/creating-a-future-proof-responsive-email-without-media-queries--cms-23919 这里有一篇很棒的文章: http : //webdesign.tutsplus.com/tutorials/creating-a-future-proof-respond-email-without-media-queries--cms-23919

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM