How to embed CSS on emails

Embed CSS on email

The simplest way to have css embedded on email and getting around the issue for things like font, font color and font size: For example – Gmail converts your Body tag to a DIV.  That can actually work to your advantage because you can use any inline CSS properties within your BODY that would otherwise be supported by a DIV.

It is important to know, however, that some clients do not support the BODY tag so you should also include the same declarations within your embedded CSS.  Also, keep in mind, you can’t rely on BODY attributes like “bgcolor” because it is not supported within a DIV.

<head>
<style type=“text/css”>
/*This is for all clients except Gmail,
Gmail gets the same declarations from the body tag */
table, tr, td, p, span {
font-family:Arial, Helvetica, sans-serif;
color:#333; font-size:11px;
}
</style>
</head>
<body style=“margin:0; padding:0; font-family:Arial,
Helvetica, sans-serif; color:#333; font-size:11px;”>
Content
</body> 

Rogerio da Silva

Test Analyst (ISTQB-ISEB Certified Tester) | Test Lead | Business Test Analyst | Entrepreneur | Investor Share, Stocks, Forex and Cryptocurrency | Social Media Marketing | Social Media Management | Website Consulting & Revision | Email Consulting (Funnel Setup) Rogerio da Silva is a Consultant as a day job and big fan of personal development and entrepreneurship. Feel free to follow him on LinkedIn, Twitter, Facebook Page, Tumblr, Google+ to talk about ideas, investments, business opportunities in UK and Brazil.

Leave a Reply

%d bloggers like this: