0

I'm creating a custom template in MailChimp, all styles are inline, but when I send a preview, Gmail either just doesn't display those styles, or alters them.

For example:

<span style="display: inline-block;width: 35px;height:4px;background-color: #ff4229;">&nbsp;</span>

Gmail will render as:

<span style="display:inline-block;width:35px;min-height:4px;background-color:#ff4229;"> </span>

Does anyone have an idea as to why this is happening? Thanks!

EDIT: I added max-height to inline style and now it's ok.

caligula
  • 1
  • 2

1 Answers1

0

The issue can stem from quite a few things, but likely is done by Gmail's preprocessor to ensure that it is safe to display within their email client. Basically this means that it makes changes to HTML/CSS that may cause issues (whether display or security) with the HTML/CSS that is used on their email client.

Outside that it could be from a million different ways the email gets read and edited on the way to your recipients inbox.

Please see links below for more info on this process:

https://litmus.com/blog/why-do-email-clients-render-emails-differently?utm_campaign=industry&utm_source=litmusblog&utm_medium=blog

https://litmus.com/blog/why-email-designs-break-rendering-guide-infographic?utm_campaign=industry&utm_source=litmusblog&utm_medium=blogs-break-rendering-guide-infographic

https://litmus.com/blog/webmail-rendering-explained-why-preprocessors-are-the-enemy

Also, height, width, display AND background-color are not accepted on a span for most email clients. There is even some contention on using DIV tags in email due to spotty support. You will need to utilize tables for most of these purposes. See below for some links on layout for HTML emails:

https://www.campaignmonitor.com/blog/email-marketing/2011/05/div-tags-in-html-email-newsletters/

HTML email: tables or divs?

Community
  • 1
  • 1
Gortonington
  • 3,427
  • 2
  • 17
  • 30