-
Notifications
You must be signed in to change notification settings - Fork 967
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
Missing background-color in Windows 10 #572
Comments
I'm not sure this is your problem, but you have a typo in your code: <mj-container` <--- Remove the backtick :) |
Hey @Honza-B, indeed Windows 10 is the only email client that ignores the background color style on the body or the div. The only way I know to achieve that is to wrap the very first table in the Outlook conditional comment in another 100%-width table, with a Original HTML: <body style="background: green;">
<div style="background-color:green;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="700" align="center" style="width:700px;">
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<![endif]-->
...
<!--[if mso | IE]>
</td></tr></table>
<![endif]-->
</div>
</body> Edited HTML to apply the background-color in Windows 10 Mail: <body style="background: green;">
<div style="background-color:green;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" align="center" style="width:100%;" bgcolor="green">
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="700" align="center" style="width:700px;">
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<![endif]-->
...
<!--[if mso | IE]>
</td></tr></table>
</td></tr></table>
<![endif]-->
</div>
</body> Let me know if it works for you |
@ngarnier I applied this fix to a simple test with Here is my short example:
|
@justincolangelo thanks for noticing this, there is indeed a problem with the way Outlook handles z-index, so the vml for mj-hero's image will either be under the background, or over it's own content. Edit: the workaround i was giving is actually broken, i'll try other ways. The above workaround works if you don't use mj-hero. |
I'll close this issue since there doesn't seem to be a solution that works consistently. |
Wouldn't the proper solution be to change the code so that the very first table in the Outlook conditional comment gets wrapped in another 100%-width table with a bgcolor set (as suggested by @ngarnier) by default? Or atleast if a background-color is set on mj-body. This won't solve the problem if a mj-hero is involved but at least solves the background-color problem in general. Btw: I'm still facing this issue with MJML4 and Outlook 2016:
|
Hello,
maybe this is duplicity, but I've just started test my emails on Windows 10 mail client and there is no backround color sets to mj-container.
Here is example of code:
Am I missing something?
Thanks for help!!!
The text was updated successfully, but these errors were encountered: