tl;dr does anyone know why a typo in my <style/> tag could be fixing my android gmail full-width issues (and can this potentially be exploited for some creative email layout hacks)?


I've been having a very difficult time with Android Gmail clients for the newsletter I'm working on. No matter what I did, my 100% width email would render slightly wider than the device, requiring the user to scroll horizontally in order to view the entire content (and by slightly wider, I mean maybe 105%-110% actual width max). Also worth noting, none of the Litmus previews had this issue; it was only noticed through old-school physical-device-testing.

I had already tried a bunch of the Android-Gmail-not-respecting-100%-width solutions, but nothing seemed to work exactly. Exasperated, I tried to !important all the things just to see what happens. Next thing I know, it's fixed. Or so I thought. In code review, it was noticed that I had mis-typed 'important' as 'impgortant'. Upon correcting the typo, the issue was appearing again.

I tried removing the rule that was mistyped to see if breaking it simply removed a problematic rule from the stylesheet, but that didn't fix it either. It only worked when I added '!*anythingbutimportanthere*'

I was wondering if anyone had any insight into why this worked. Does a typo in the stylesheet result in some bizarre interpretation of it? Upon inspecting desktop Gmail, the offending typo is properly corrected to '!important', but for whatever reason, including the typo fixes our Android gmail issues.

The offending css is below:

body, #body_style { height: 100% !important; margin: 0 !thismakesandroidgmailworkforsomereason; padding: 0 !important; width: 100% !important; color:#000000 !important; letter-spacing: 0 !important;
    font-family:-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif!important;-webkit-text-size-adjust:none;
  }

I post this for two reasons:
1) it's going to be hard to sleep at night with this in produciton until I figure out what's going on
2) maybe someone who knows more about how android gmail parses CSS as compared to other clients could figure out how to exploit this for some creative android gmail hacks