tags:

views:

2239

answers:

5

Since a lot of email clients ignore the HEAD tag, can I embed an inline stylesheet in the body?

+7  A: 

The short answer is no. Gmail strips the tag and it's content.

Hotmail, Yahoo! Mail and Windows Live Mail does not strip style-tags in the body-element.


But take a look at this great guide over at Campaign Monitor.

roosteronacid
A: 

Yes you can. However you have to keep in mind that few email clients respect css standards. Just stick to basic css properties (like margins, padding, etc) and it should be fine.

Also you can style your html elements inline (< div style= " ") though it's not an elegant solution.

teebot.be
A: 

No body likes html email.

Mark Lubin
Are you having fun back there in 1994?
MrZebra
I think it's a pun. Lighten up, people.
Traingamer
Although I agree with Traingamer, I have to say that this is a poorly placed joke. The SO community wants to ensure that questions are taken seriously and that people aren't "polluting the waters".
Justian Meyer
A: 

You might want to check out the free html email templates that CampaignMonitor and MailChimp provide:

http://www.campaignmonitor.com/templates/

http://www.mailchimp.com/resources/templates/

There's an updated version of Campaign Monitor's helpful guide here: http://www.campaignmonitor.com/css/

Unfortunately, the most reliable HTML to use in emails is totally stone age

Andy Ford
A: 

Creating an HTML email that works in every email client is hard. I spent several months refining a good looking template.

http://commadot.com/the-holy-mail/ - original blog with my findings.

http://commadot.com/email-best-practices/ - latest greatest.

Specific answer to your question: Gmail will be ok with style="" but not with a style block.

Glen Lipka