-
Notifications
You must be signed in to change notification settings - Fork 20
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gmail on iOS and Android don't always display emails at full width #57
Comments
интересно.. |
I've seen the same behavior as @burdyga mentioned when applying the fixes listed above. Couldn't ever get it to look good in both iOS and Android. |
Going by what @burdyga has said. What about adding in a media query to target iOS with the gmail fix then it would look fine in the Android 6 & 7? Something like:
|
Hi, Don't know if this helps anyone. I found if I add the below u + #body { It seems to centre in both android and gmail for me now, according the the screengrabs from EOA. If I remove the max-width: 100%!important; it forces the table in android over to the right, but this seems to keep it centred. Thought I would share :-) thanks, |
Hello Lucyanne, The code worked great for mobile. However it messed up the gmail version of desktop. My email is now right aligned. (You have to scroll to the right to see entire email) |
Hi @jreasydoesit30 |
@lucyanne, |
@lucyanne You are awesome, thank you for the tip re: "just referencing this inside a media query so it targets mobile only." This worked to show full-bleed images for Apple Mail mobile, Gmail mobile, Outlook mobile. Related: https://litmus.com/community/discussions/6865-ios11-makes-strange-not-100-width-in-native-mail-app |
Gmail's mobile apps have a custom behavior that don't always display emails at full width. Consider the following example:
You'll get the following rendering, with a 16px non removable margin on the left but a 62px margin on the right.
By copying the content and pasting it, I was able to inspect the code transformed by Gmail. The previous example became:
There are two popular fixes for this bug, that both consist in forcing a width on the table larger than the available width in Gmail.
u + #body { width:100vw !important; }
rule. Gmail replaces the doctype of an email by a<u>
tag. By adding a specificid
to the<body>
of your email (like<body id="body">
), you can target Gmail only.When using these fixes, here's the obtained render. There is now an equal 14.5px margin on both horizontal sides (29px at 2x on an iPhone SE screen).
Gmail transforms the main table as below, adding a
data-zoom="1"
attribute and azoom:1
property:What I can't wrap my head around is that the table's width is also set to
320px
, even though the real displayed width is of291px
(on a 320px wide iPhone SE screen).The text was updated successfully, but these errors were encountered: