Šime Vidas
Šime Vidas

Reputation: 185933

Do HTML email templates require the use of the style attribute?

Are there scenarios where it is (for some reason) required to place the CSS rule inside the style attribute of the HTML tag directly instead of placing the CSS rule inside a selector in the STYLE element in the HEAD of the HTML email template?

(I am asking for the most common CSS selectors, like type, class, ID, descendant combinations)

Follow-up question:

Gmail seems to be the only relevant email service that does not support the STYLE element. Why is that? (What's the reasoning behind this decision from Google?)

Upvotes: 2

Views: 4748

Answers (2)

Rishi Gupta
Rishi Gupta

Reputation: 133

Style attribute is supported in most of the email clients but not all. For example Gmail's mobile app tends to removes head tag and classes. It will be better if you use inline css instead of an external and internal one.

Upvotes: 1

Andrew Jackman
Andrew Jackman

Reputation: 13966

Yes, for example google gmail won't handle the STYLE element in the HEAD.

Look at this site for email clients and what they can/can't do regarding css: http://www.campaignmonitor.com/css/

Upvotes: 6

Related Questions