HTML email align text

前端 未结 3 607
一生所求
一生所求 2020-12-03 07:46

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 lookin

相关标签:
3条回答
  • 2020-12-03 08:08
    <p align="right">My right content</p>
    

    It should do the trick as it is HTML1.

    0 讨论(0)
  • 2020-12-03 08:09

    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.

    0 讨论(0)
  • 2020-12-03 08:10

    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/

    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.

    0 讨论(0)
提交回复
热议问题