HTML email align text

こ雲淡風輕ζ 提交于 2019-11-27 22:05:46

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/

For your example:

<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.

Use (shudder) layout tables.

Outlook's support for styling of email is so awful that there isn't any other way.

There is a 24 ways article with some general advice for writing HTML formatted email.

<p align="right">My right content</p>

It should do the trick as it is HTML1.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!