What's the best way to center your HTML email content in the browser window (or email client preview pane)?

前端 未结 7 1993
悲&欢浪女
悲&欢浪女 2020-12-07 14:15

I normally use CSS rules for margin:0 auto along with a 960 container for my standard browser based content, but I\'m new to HTML email creation and I\'ve got

相关标签:
7条回答
  • 2020-12-07 15:12

    Here's your bulletproof solution:

    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="33%" align="center" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:2px; color:#ffffff;">.</td>
        <td width="35%" align="center" valign="top">
          CONTENT GOES HERE
        </td>
        <td width="33%" align="center" valign="top" style="font-family:Arial, Helvetica, sans-serif; font-size:2px; color:#ffffff;">.</td>
      </tr>
    </table>
    

    Just Try it out, Looks a bit messy, but It works Even with the new Firefox Update for Yahoo mail. (doesn't center the email because replace the main table by a div)

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