HTML电子邮件对齐文本 [英] HTML email align text

查看:296
本文介绍了HTML电子邮件对齐文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将文本的一部分与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电子邮件, d坚持使用表。并不是所有的电子邮件客户端都可以使用所有的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:

http://www.campaignmonitor.com/css/

http://www.emailology.org/

对于您的示例:

<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屋!

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