Outlook不支持HTML边距 [英] HTML margins not supported in Outlook

查看:110
本文介绍了Outlook不支持HTML边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个具有动态间距的电子邮件模板,因此我将位置设置为边距,例如:

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

<td width="264px" bgcolor="#9ac5db" style="font-family:arial;font-size:12px;color:#000000;padding: 10px 5px 30px;" valign="top">
    <div name="nltitle" id="nltitle" style="font-family:arial;font-size:14px;color:#000000;display:block;text-align:center;margin:15px 0px 15px 0px;"><b>Test App</b></div>
                             
    <hr width="100%" color="#ffffff" size="3px">
                                         
    <div style="margin:10px 10px 30px 10px;text-align: left">
        Test App       
    </div>                             
</td>

在这里,我使用了填充和边距来动态设置空格,但是在Outlook中它不起作用.如何解决此问题?非常感谢您的帮助.

Here I used padding and margin for setting the spaces dynamically, but it is not working in Outlook. How can I fix this issue? Any Help is highly appreciated.

干杯

乔治

推荐答案

Outlook.com不支持保证金,因此通常在html电子邮件设计中应避免使用保证金.而是使用mdesdev建议的& nbsp; 填充或间隔表单元格.

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 &nbsp; like mdesdev suggests.

其他一些提示:

  • 您应在 width =" 声明中删除"px"
  • 添加后备字体,因为非Windows用户没有Arial
  • 使用HTML align ="left"
  • 代替CSS text-align:left;
  • 您不需要div,可以使用所有表
  • 您可能需要将速记的 padding 值分为 padding-top padding-bottom 等.从内存中看,我认为可能是在某些电子邮件客户端中将它们写成简写的问题.
  • 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...

这篇关于Outlook不支持HTML边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆