How to embed CSS on emails

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.

[notification type=”alert-info” close=”false” ]<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> [/notification]

Author

  • Rogerio da Silva is a Brazilian who lives in the UK for a little over two decades. He is the owner of a test consulting and outsources services for software development. He likes to blog, write and create content that teaches others how to live a better life.  He loves reading biographies of successful authors and dream builders because they inspire him to keep creating!
    You can contact Rogerio for anything related to Business & Test Analyst | Microsoft Dynamics 365 CRM | QA | Agile | Manual | Integration & Automation | DevOps | API | Cloud | AI | IoT | CRM | Website Consulting | Email Consulting | Facebook Ads | Social Media Marketing Plan | Sales Funnel | Looking for Scalable Services? InShore, OffShore or Hybrid. Interested? Ask me how we can help.

Leave a reply

Publication

Now available on amazon prime

eBook (Amazon)

The Testers Book - An Unconventional Way to Software Testing - Revised Edition

Paperback (Lulu.com)

Podcast