Margin in html not working in Outlook

前端 未结 2 1683
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-02 05:05

I am developing an email template which has the spacing as dynamic, so I made the position as margin,

For Eg:



        
相关标签:
2条回答
  • 2021-01-02 05:36

    the answer is simple

    instead of this give

    margin:10px 10px 30px 10px;
    

    please use this

    Margin:10px 10px 30px 10px;
    

    and also Mr.George using div is not a good

    0 讨论(0)
  • 2021-01-02 05:57

    Margin is not supported in Outlook.com, so typically you should avoid it in html email design. Instead use padding or spacer table cells with   like mdesdev suggests.

    A few other tips:

    • You should remove the 'px' in your width="" declarations
    • Add fallback fonts as non-windows users don't have Arial
    • Instead of CSS text-align:left;, use HTML align="left"
    • You don't need the divs, you can use all tables
    • You may have to separate your shorthand padding values into padding-top, padding-bottom etc. From memory I think there might be issues writing them short hand in some email clients.

    More info than you asked for, but I hope it helps...

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