Do I need to use style attribute everywhere, which leads to lots of duplication?
<p style="color: red; font-weight: bold;">Some text</p>
Use of <style>
seems to fail
Do I need to use style attribute everywhere, which leads to lots of duplication?
<p style="color: red; font-weight: bold;">Some text</p>
Use of <style>
seems to fail
Many email clients will strip out CSS and classes, and one of the ways to ensure your content gets through is to use inline-css
. As pointed out, this is time consuming and a pain to maintain.
Fortunately the kind people over at mail chimp have developed a CSS Inliner tool.
So you can develop your email using CSS classes as you normally would, paste the html in to the tool, and receive correctly inlined CSS, perfect for emailing.
Takes a bit of tweaking and you need to declare everything, but it definitely does make life easier.
(e.g you have to declare font family, size and colour for p, h1, h2, h3, td, ul
rather than just body
, for instance).