

MJML SECTION HOW TO
The solution above seems to fix the issue and not break any other clients. Nicole says it’s important to know how to specify CSS selectors when coding with MJML.

Adding the fallback directly on the table or div breaks the background image and only displays ~20px at the bottom. So when mjml adds background:#5784cd url() top center / auto repeat outlook 16/win 10 ignores the background prop. If the css prop is not supported, it ignores the whole thing. Mj-section should display a background image in clients that support it and fallback to a solid color for those that don’t.īackground image does not load and displays a broken image.
MJML SECTION WINDOWS 10
Windows 10 doesn’t support vml anymore (fuck!) so I think the best solution is to whitelist this version from the vml conditionalĪnd add the background color as a fallback to the table that wraps the whole mj-section when the background-url is present: Works correctly with no background image If you do use background images in your emails, be sure to thoroughly test and have fallbacks in place, such as a background color, for when background images aren’t supported. However, they can be used as an added bonus, or finishing touch to email designs. This should act as a reminder to not use background images to visualize important messaging in your email. However, this doesn’t work in Windows 10 Mail.
The great thing aboutThe go-to solution to combat this issue in Outlook 3 uses a combination of VML and HTML to enable background images. This layout is again explicit with MJML, we just have to create a section and wrap the four columns inside. Here is the litmus test with a solid background and with a background image (breaking): įrom the announcement when Litmus added Windows 10 to their preview:īackground images are, as in Outlook, not supported. The Windows 10 mail client doesn’t support background images, even with the outlook specific vml hack we’ve had to use for backgrounds in outlook. Is there a trick to modifying these files? I’m also day 3 into my mjml journey, so I’m posting as an issue 💯 :
MJML SECTION CODE
For this run though, we’ll use a web version that converts the code to production-ready HTML, more on that later.This would have been a pr but I couldn’t get my changes in packages/mj-section to actually do anything in the final template. MJML is a markup language designed to reduce the pain of coding responsive.

MJML comes with an NPM installation if you’re into that kind of thing. It would have saved a few headaches on that outlook image issue.
If you’re me, six years ago as a design intern charged with prototyping responsive HTML emails, I’m sorry this wasn’t available back then. Include top branding elements and first story block ->