HTML formatted email not showing up at all in Gmail but is in other mail clients

喜你入骨 提交于 2019-12-02 17:25:16

I am updating my answer since it has quite a few views, and new tools are available. I am leaving my original answer for posterity.

Edit * 9/19/19

You can find CSS property support by email client here: https://www.caniemail.com/


Original Answer:

Gmail does not support the <style> tag. You need to use inline css for gmail to work correctly.

Here's a reference list. http://www.campaignmonitor.com/css/

GMail doesn't support <style> tags and neither does a number of clients. To make your life easier, you can use convert to convert your style tags to inline CSS: http://beaker.mailchimp.com/inline-css

I see you're using an ID named #footer. It seems that Google doesn't recognize that name when dealing with mails. Notice that in the font code seen from gmail, all your ID might appear with "exc" + idName, except #footer. Try to use a different name.

The above answers are pretty good, just wanted to add a few more points. All credits to this link:

  1. Gmail only supports <style> in the <head>. Gmail does support embedded styles (<style>). However, embedded styles are only supported in the head of your HTML document. The Gmail Android and iOS apps does not support <style> at all when rendering emails retrieved through non-Google accounts (GANGA).

  2. Gmail removes your entire <style> block if it encounters an error.

  3. Gmail does not allow negative CSS margin values.

  4. Gmail does not support attribute selectors and most pseudo-classes. e.g. div[class="content"]{ color: red }. Gmail also does not support pseudo-classes like :checked and :active.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!