Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Gmail blocking CSS in emails?

I used CSS in my email and sent it out.

When I received the email in Gmail, all the CSS was disabled; however, when I retrieved the email in thunderbird or outlook, everything is OK.

How would I fix this?

like image 709
MemoryLeak Avatar asked Oct 12 '09 15:10

MemoryLeak


People also ask

Does Gmail strip CSS?

Gmail, along with many other email clients, can be a bit funky to code for. For one, it strips out any CSS that's outside the body. So putting in things like media queries and document level styles don't work. The best piece of advice I can give you is hand code your inline CSS and try to avoid anything fancy.

Why is Gmail blocking my emails?

Generally, Gmail blocks your email for one of several reasons. You are sending large volumes of email. There are sudden changes in email volume. You are sending emails to “spam trap” addresses.


2 Answers

Gmail doesn't block CSS totally. It still supports inline style. Why doesnt it support style block, I've no idea. To have a good overview of CSS support in various webmail and email clients, here's a good one. http://www.campaignmonitor.com/css/

like image 72
o.k.w Avatar answered Sep 26 '22 17:09

o.k.w


I am answering it too late but this may help someone here. To be able to view your mail as it is in gmail and other email clients, you need inline style for each tag in your html, but writing inline css for each html tag is time consuming, to save your time use the builtin tool

http://templates.mailchimp.com/resources/inline-css/ 

Just paste your whole email template and you will get the html document with inline css in each tag. That much easy :)

Note: you can have your class and id in class as it is.

like image 24
Kashif Ullah Avatar answered Sep 25 '22 17:09

Kashif Ullah