Does Gmail support CSS classes?

The title is really just an abridged version of the question. I know that Gmail support is limited to CSS, but I read the CSS Email Support Guide , which contains a note on Gmail support .class and #id :

(!) Works in some cases if CSS is embedded before or during campaign import

What does this mean for CSS support? For me, it looks like he just suggests using a preprocessor to accept any style declarations and apply them to the matched elements.

Is there a trick to being able to use CSS classes in HTML email in a Gmail client?

+2
source share
2 answers

Gmail will only use inline CSS. It will not allow the use of internal or external style sheets. Rather, I found support at best unreliable. Use this tool to convert your internal and external styles to your own:

http://inlinestyler.torchboxapps.com/styler/

It even tells you how well your document is supported in different email clients. This will allow you to develop more intelligently, and only convert it at the end.

+8
source

Gmail currently supports the .class and #id selector and internal stylesheets (i.e. tags). You should keep in mind that some styles are modified by Gmail. For example, you cannot use negative margins or shadow shadows.

However, I'm not sure about external style sheets. I have not tested them.

0
source

Source: https://habr.com/ru/post/1202225/


All Articles