Formatting html email for Outlook

前端 未结 3 576
情书的邮戳
情书的邮戳 2020-12-29 22:02

I have an html newsletter which works in most email clients, but the formatting is messed up in Outlook.



        
3条回答
  •  囚心锁ツ
    2020-12-29 22:25

    To be able to give you specific help, you's have to explain what particular parts specifically "get messed up", or perhaps offer a screenshot. It also helps to know what version of Outlook you encounter the problem in.

    Either way, CampaignMonitor.com's CSS guide has often helped me out debugging email client inconsistencies.

    From that guide you can see several things just won't work well or at all in Outlook, here are some highlights of the more important ones:

    • Various types of more sophisticated selectors, e.g. E:first-child, E:hover, E > F (Child combinator), E + F (Adjacent sibling combinator), E ~ F (General sibling combinator). This unfortunately means resorting to workarounds like inline styles.
    • Some font properties, e.g. white-space won't work.
    • The background-image property won't work.
    • There are several issues with the Box Model properties, most importantly height, width, and the max- versions are either not usable or have bugs for certain elements.
    • Positioning and Display issues (e.g. display, floats and position are all out).

    In short: combining CSS and Outlook can be a pain. Be prepared to use many ugly workarounds.

    PS. In your specific case, there are two minor issues in your html that may cause you odd behavior. There's "align=top" where you probably meant to use vertical-align. Also: cell-padding for tds doesn't exist.

提交回复
热议问题