Formatting html email for Outlook

前端 未结 3 577
情书的邮戳
情书的邮戳 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.

    0 讨论(0)
  • 2020-12-29 22:34

    I used VML(Vector Markup Language) based formatting in my email template. In VML Based you have write your code within comment I took help from this site.

    https://litmus.com/blog/a-guide-to-bulletproof-buttons-in-email-design#supporttable

    0 讨论(0)
  • 2020-12-29 22:40

    You should definitely check out the MSDN on what Outlook will support in regards to css and html. The link is here: http://msdn.microsoft.com/en-us/library/aa338201(v=office.12).aspx. If you do not have at least office 2007 you really need to upgrade as there are major differences between 2007 and previous editions. Also try saving the resulting email to file and examine it with firefox you will see what is being changed by outlook and possibly have a more specific question to ask. You can use Word to view the email as a sort of preview as well (but you won't get info on what styles are/are not being applied.

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