【问题标题】:Right aligning image for Outlook emailOutlook 电子邮件的右对齐图像
【发布时间】:2013-01-21 21:07:53
【问题描述】:

我使用浮动右对齐图像。

<div align="left">
   Insight
   <img height="20" style="float:right;" src="https://mydomain/myimage.jpeg">
</div>

我将此 html 作为电子邮件发送。但是,在 Microsoft Outlook 中,图像没有正确对齐,因为我认为 ms Outlook 不支持浮动。

还有其他方法可以右对齐吗?

【问题讨论】:

  • 表格是你的答案:)
  • 我的答案是你想要的吗?

标签: html css


【解决方案1】:

表格、嵌套表格和更多表格是 Outlook 的关键。

<table width="100%" cellspacing="0" cellpadding="0" border="0">
    <tr>
        <td align="right" valign="top">
            <img height="20" src="https://mydomain/myimage.jpeg">
        </td>
    </tr>
</table>

【讨论】:

  • 此外,我们使用带有透明 gif 和固定宽度和高度的 td 用于填充,&lt;font style="font-family: Arial; font-size: 14px; color: #000000"&gt; 用于所有文本样式。