emailmonday / Cerberus

A few simple, but solid patterns for responsive HTML email templates and newsletters. Even in Outlook and Gmail.

Home Page:https://www.cerberusemail.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gmail IOS App ignoring media queries

superpowered opened this issue · comments

In the cerebrus-fluid template the gmail Ios app ignores everything in the style block if this style is present:

 /* What it does: Centers email on Android 4.4 */
        div[style*="margin: 16px 0"] {
            margin: 0 !important;
        }

with:
img_3841
without:
img_3843

As far as I can tell *[x-apple-data-detectors] does not cause the block to be ignored, even though it's also an attribute selector.

My guess is that this is meant to target the very top level div .email-container ?

possible could just be changed to:

 /* What it does: Centers email on Android 4.4 */
       .email-container {
            margin: auto !important;
        }

@superpowered Hmm, using MailChimp? Is there a checkbox somewhere that says inline CSS? Does this behavior occur if CSS is not inlined?

@TedGoas As you suspected, it seems to be a Mailchimp specific thing. Using Putsmail.com (and choosing not to inline) I did not get the same issue.

Looking at it a bit more, Mailchimp isn't inlining anything (as far as I can tell) but it does do some "Formatting" automatically, such as combining separate style blocks. And in this process it decided to strip the " fom the div[style*="margin: 16px 0"] causing it to be div[style*=margin: 16px 0], and thus incorrect.

@superpowered Cool thanks for pointing this out and following up with what was going on in MailChimp. Good to know!