How to style emails?

前端 未结 4 635
情书的邮戳
情书的邮戳 2020-12-12 00:10

Do I need to use style attribute everywhere, which leads to lots of duplication?

Some text

相关标签:
4条回答
  • 2020-12-12 00:16

    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).

    0 讨论(0)
  • 2020-12-12 00:18

    use direct 'style' attribute for all tags, like teneff said in one of the answers here: 'not all email clients support full featured html'

    0 讨论(0)
  • 2020-12-12 00:24

    You should be able to used the

    Here is a complete guide:

    HTML Email CSS Guide

    Hope it helps.

    0 讨论(0)
  • 2020-12-12 00:31

    you have to use style, but if you want it to be available for all of the email clients I can suggest you to use <font size="2" color="red"><b>Some text</b></font>

    0 讨论(0)
提交回复
热议问题