HTML 电子邮件对齐文本 [英] HTML email align text
问题描述
我试图在 HTML 邮件中将文本的一部分向右对齐,另一部分向左对齐,但在 Outlook 中,float
不起作用.所以基本上我在 Outlook 中寻找 float
CSS.我知道这听起来很令人毛骨悚然,text-align
或 align=""
不起作用.有什么建议?
I am trying to align a part of text to the right and the other part to the left in an HTML mail but in Outlook the float
doesn't work. So basically I am looking for float
CSS in Outlook. I know it sounds pretty creepy and text-align
or align=""
didn't work. Any suggestions?
<td>
<span style="text-align:left; float:left;">
First part
</span>
<span style="text-align:right; float:right;">
Second part
</span>
</td>
推荐答案
老实说,如果您正在处理 HTML 电子邮件,我会坚持使用表格.并非所有的电子邮件客户端都可以使用所有的 CSS 选择器,如果你想以任何其他方式去做,你会发疯.HTML 电子邮件就像 5 年前的网络.
Honestly, if you're doing an HTML email I'd stick to using tables. Not all CSS selectors are available in all email clients and you'll drive yourself mad trying to do it any other way. HTML emails are like the web 5 years ago.
有几个关于这个主题的好文件:
There are a couple of good documents on the subject:
https://www.campaignmonitor.com/css/
例如:
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left">First part</td>
<td align="right">Second part</td>
</tr>
</table>
</td>
这很可怕,但不幸的是它仍然是最好的方法.
It's horrible but unfortunately it's still the best way.
这篇关于HTML 电子邮件对齐文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!