How to style emails?

前端 未结 4 643
情书的邮戳
情书的邮戳 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).

提交回复
热议问题