Outlook 不支持 HTML 边距 [英] HTML margins not supported in Outlook
问题描述
我正在开发一个电子邮件模板,它的间距是动态的,所以我将位置设置为边距,例如:
<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宽度=100%";颜色=#ffffff";大小=3px"><div style="margin:10px 10px 30px 10px;text-align: left">测试应用</td>
这里我使用了填充和边距来动态设置空格,但它在 Outlook 中不起作用.我该如何解决这个问题?非常感谢任何帮助.
干杯,
乔治
解决方案 Margin 在 Outlook.com 中不受支持,因此通常您应该在 html 电子邮件设计中避免使用它.而是像 mdesdev 建议的那样使用带有
的填充或间隔表格单元格.
其他一些提示:
- 您应该删除
width=""
声明中的px" - 添加后备字体,因为非 Windows 用户没有 Arial
- 代替 CSS
text-align:left;
,使用 HTML align="left"
- 你不需要div,你可以使用所有表格
- 您可能需要将速记
padding
值分成 padding-top
、padding-bottom
等.从记忆中我认为可能有在某些电子邮件客户端中简写它们的问题.
比您要求的更多信息,但我希望它有所帮助...
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>
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.
Cheers,
George
解决方案 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...
这篇关于Outlook 不支持 HTML 边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文
登录
关闭
扫码关注1秒登录
发送“验证码”获取
|
15天全站免登陆