HTML,即使使用CID,我如何左对齐图片?

时间:2012-09-18 17:32:02

标签: html css text-alignment

我正在尝试为电子邮件创建界面。我想导入一张图片,但如果没有cid,我就无法做到。例如:

这很好用。但我似乎无法将文字放在图片的左侧。请查看下面的代码以便更好地理解!

<div style="background-color:black;">
<body style="font-color:white;">
    <h1><i>Airline Credits</i></h1>
    </br>
    </ul>
    Dear [FullName],<br/>
    Thank you for your <i>Airline Credits</i> redemption. Below is a summary of your order:

    <b>Order Date:</b>[OrderDate]<br/>
    <b>Description:</b>[ItemName]
    <br/><b>Redemption Amount:</b>[CostInPoints]
    <br/><b>Order Tracking Number:</b>[OrderNumber]

    <br/><br/>
    <b>Please note:</b>
    If you did not make this request, please contact us immediately at [AirlinePhoneNumber]. Our Customer Service Representatives are available to help you.

    <br/><br/>
    Please read the terms and conditions for Airline Credits Redemptions at <a href="[WebSiteAddress]">[WebSiteAddress]</a> about how you are provided your redeemed items. To view your Airline Credits balance, please <a href="[EMLink]">click here</a>
    <br/>
    <img src=cid:AirlineCredits.jpg/>
</body>
</div>

1 个答案:

答案 0 :(得分:3)

HTML电子邮件很痛苦 - 没有什么固有的,但是因为微软决定让Outlook 2007,2010和2013使用Word的可怕破坏和糟糕的HTML渲染实现(而Outlook 2003使用的是IE)。

Outlook的浮动框支持不佳,所以我建议在这种情况下反对它。

无论如何,通常我是一个网络标准狂热者 - 但在HTML电子邮件中似乎并不重要,所以我只想说使用表格,如下:

<table border="0"> <!-- Tim Berners-Lee, forgive me, for I have sinned. -->
    <tr>
        <td>
            <p>Please read the terms and conditions for Airline Credits Redemptions at <a   href="[WebSiteAddress]">[WebSiteAddress]</a> about how you are provided your redeemed items. To view your Airline Credits balance, please <a href="[EMLink]">click here</a></p>
        </td>
        <td> <img src=cid:AirlineCredits.jpg /> </td>
    </tr>
</table>

相对无痛,完成工作。

(并导致我死在里面)。