图片未固定(电子邮件营销,使用)

时间:2018-07-16 13:27:59

标签: html email html-table

我正在使用<td><tr>进行电子邮件营销。除2个主要图像外,所有图像均已就绪。 我尝试不添加display:block,尝试添加它,尝试了很多事情,将图像切成2等,但是这种情况一直在发生。

我将添加图片以更好地理解:

Here we can see that image on the right that is completely out of place

我做错了什么?

我正在使用的代码:

    <table border="0" cellpadding="0" cellspacing="0" style="width:658px">
        <tbody>
            <tr>
                <td> <td style="display: block"></td><img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok">
        </td> <td> 
        <td style="display: block"></td> <img src="Images that are causing trouble"><img src="Images that are causing trouble"></td><br>
        <td> <td style="display: block"></td>
    <img src="Images that are ok"> <img src="Images that are ok"><img src="Images that are ok"></td>
            </tr>

编辑:我解决了这个问题,但是现在即使在使用“ display:block”时,每个图像之间也有空白。我该怎么办?

4 个答案:

答案 0 :(得分:0)

我会从所有style="display: block"中删除td –这将覆盖/取消其表单元格属性,这可能是造成麻烦的主要原因(此外,如注释中所述,您不应该'请将td嵌套在另一个td中)。

答案 1 :(得分:0)

<table border="0" cellpadding="0" cellspacing="0" style="width:658px">
    <tbody>
        <tr>
            <td>
                <img src="Images that are ok"> 
                <img src="Images that are ok"> 
                <img src="Images that are ok"> 
                <img src="Images that are ok">
            </td> 

            <td>
                <img src="Images that are causing trouble">
                <img src="Images that are causing trouble">
            </td>
            <br>

            <td>
                <img src="Images that are ok"> 
                <img src="Images that are ok">
                <img src="Images that are ok">
            </td>

        </tr>
    </tbody>
</table>

答案 2 :(得分:0)

主要问题是您在一个td中使用了多个tr。一个tr是一行,每个td将该行拆分为另一列。如果要使图像一个接一个,则需要使用多行。

此外,您的代码不太正确。您需要删除td中的嵌套td。在br之间的td也是一个坏主意。

<table border="0" cellpadding="0" cellspacing="0" style="width:658px">
    <tbody>
        <tr>
            <td> <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok">
    </td> 

                                      

答案 3 :(得分:0)

您的代码中嵌套了一个额外的TD标记。

这应该有效:

<table border="0" cellpadding="0" cellspacing="0" style="width:658px">
<tbody>
<tr>
    <td style="display: block">
        <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok"> <img src="Images that are ok">
    </td>
    <td style="display: block">
        <img src="Images that are causing trouble"><img src="Images that are causing trouble">
    </td>
    <td style="display: block">
        <img src="Images that are ok"> <img src="Images that are ok"><img src="Images that are ok">
    </td>
</tr>
</tbody>