Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

css - Gmail Responsive Email - Media Queries - Style Tag

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! :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...