HTML中的边距在Outlook中不起作用 [英] Margin in html not working in Outlook
问题描述
我正在开发一个具有动态间距的电子邮件模板,所以我将位置设置为边距,
I am developing an email template which has the spacing as dynamic, so I made the position as margin,
例如:
<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建议的带有
的填充或间隔表单元格.
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.
其他一些提示:
- 您应该在
width=""
声明中删除"px" - 添加后备字体,因为非Windows用户没有Arial
- 使用HTML
align="left"
代替CSS - 您不需要div,可以使用所有表
- 您可能必须将速记
padding
值分成padding-top
,padding-bottom
等.从内存中,我认为在某些电子邮件客户端中将它们写为速记可能会出现问题.
text-align:left;
- 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 HTMLalign="left"
- You don't need the divs, you can use all tables
- You may have to separate your shorthand
padding
values intopadding-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...
这篇关于HTML中的边距在Outlook中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!