Html email align text and image

£可爱£侵袭症+ 提交于 2020-01-15 10:33:53

问题


I'm having trouble aligning an image with text. The problem only occurs in outlook 03,07 & 10. See this picture to get a better understanding of my problem:

This is my code:

<td valign="middle" style="color:#fff;  font-size:18px; padding-left:3%;" width="600" height="34" bgcolor="#1a292f">
    <span class="nonmobile_content">
        Onsdag
    </span>                         
    <span style="font-weight: bold">
        21.03
    </span>                     
    <span style="color:#87bcd8;">
        2013
    </span>                     
    <span style="color:#87bcd8;">
        uke 11
    </span>
    <span>
        <img src="retriever-logo-top.png" align="right">
    </span>
</td>
<td bgcolor="#1a292f">
    &nbsp;&nbsp;&nbsp;
</td>

回答1:


Is there a reason you're putting this all in one table cell rather than putting the image in a separate cell? You could simply:

<tr>
    <td colspan="2">
        Retriever (1), Cision (2), ...
    </td>
</tr>
<tr>
    <td ... >
        <span class="nonmobile_content">
            Onsdag
        </span>                         
        <span style="font-weight: bold">
            21.03
        </span>                     
        <span style="color:#87bcd8;">
            2013
        </span>                     
        <span style="color:#87bcd8;">
            uke 11
        </span>
    </td>
    <td>
        <img src="retriever-logo-top.png" align="right">
    </td>
</tr>

Then rather adding width to each individual td simply add it to the table:

<table width="600">


来源:https://stackoverflow.com/questions/15543593/html-email-align-text-and-image

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