Gmail Responsive Email - Media Queries - Style Tag

我与影子孤独终老i 提交于 2019-11-28 05:34:19

问题


See here: Responsive emails on Gmail app (Android)

I'm trying to build a responsive email for use in all email clients. Gmail is stripping my style tags from the head/body and the queries are therefore also stripped.

I've tested using Email On Acid and Gmail just displays both versions!

What is the solution here:

1) Using a framework? - even these use style/media queries

2) External stylesheet - is there any way to make this work?

Has anyone found a permanent solution for this issue. Any advice would me much appreciated! :)


回答1:


Gmail requires that all styles be inline, It will strip out all media queries and really anything that you have in the head... If you have not coded this way i would suggest running your entire email through this http://beaker.mailchimp.com/inline-css Might solve the issue right out.

Also worth mentioning if you are not using attribute selectors with your media queries then it is going to look funny in yahoo i usually start responsive emails from here

http://webdesign.tutsplus.com/articles/creating-a-simple-responsive-html-email--webdesign-12978



来源:https://stackoverflow.com/questions/22073083/gmail-responsive-email-media-queries-style-tag

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