Why is Gmail blocking CSS in emails?

前端 未结 9 1810
心在旅途
心在旅途 2020-12-12 20:20

I used CSS in my email and sent it out.

When I received the email in Gmail, all the CSS was disabled; however, when I retrieved the email in thunderbird or outlook,

相关标签:
9条回答
  • 2020-12-12 21:10

    If you could embed styles to classes and ids in an email, those could accidentally collide with styles used by gmail to display the application, or on purpose by someone with malicious intentions. In-line styles are local to the tag, and therefor leave gmail styles alone.

    Google has to protect the user experience that it has created for people.

    0 讨论(0)
  • 2020-12-12 21:17

    I have just been testing this and it does support inline styles, makes the code a bit ugly but you can get around it all.

    Hope that helps.

    0 讨论(0)
  • 2020-12-12 21:18

    Another good source of info is the MailChimp EMail Template Reference. I find the Development section particularly useful because it includes information about what CSS GMail does support and how to take advantage of it.

    0 讨论(0)
提交回复
热议问题