I want to use media queries for the html emails I generate using jinja. The issue is that I am forced to put CSS inline for the emails for the CSS to be recognized, and media queries apparently cannot be put inline. Is there a good solution for this?

有帮助吗?

解决方案

There's no good solution. You can put the media queries inside an <style> tag but we aware that gmail doesn't support them. Gmail requires all styles to be inline, this tool could be helpful

其他提示

CSS support varies greatly depending on which email client you are using. I would suggest having a look at The Ultimate Guide to CSS (please click "Download the poster" to get the full one). As you can see clients like Gmail are very limited in what they allow. AFAIK there is no solution for what you're trying to accomplish.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top