2016-08-30 353 views
0

除了Outlook 2013 + 2016,我的电子邮件看起来很棒。似乎在我的最终表格行顶部有额外的填充。额外填充展望2013

这是我的代码。图像的高度为10px,看起来表格顶部有一个额外的10px填充。

这是你可以在上面看到的粉红色(ish)行。

enter image description here

这里是我的代码。有任何想法吗?

<table width="600" align="center" cellspacing="0" cellpadding="0" style="padding: 0 !important;margin: 0 !important; background-color: #ed5d98;" bgcolor="#ed5d98"> 
     <tr> 
     <td> 
      <table width="600" cellspacing="0" border="0" cellpadding="0" align="center style="width: 600px !important; mso-line-height-rule:exactly"> 
      <tr> 
       <td width="600" valign="bottom" style="width: 600px !important;background-color: #fff mso-line-height-rule:exactly;" bgcolor="#fff"> 
       <img width="600" src="https://eoa-editor.s3.amazonaws.com/f90c5762a5514d4fa25ece7946c98bfd37feee58%2Fframe.png" alt"" /> 
       </td> 
      </tr> 
      </table> 
     </td> 
    </tr> 
    </table> 
+0

保存您的电子邮件,并在IE中打开它。您拥有的代码不一定是由Outlook呈现的代码。 Outlook将推断您拥有的内容,并在其认为需要的地方添加默认样式和元素。 – scrappedcola

回答

0

有几件事情你可以尝试。首先将border =“0”添加到图像中,并且还可以将图像封装在div中,并将内联css高度设置为图像。此外,您可以将图像向左或向右对齐(取决于布局),并将内联边距:0px添加到图像。

0

你有mso线高度规则:完全在你的风格,但没有指定行高或字体大小,所以Outlook将假设像15px的东西。尝试添加字体大小:0; line-height:1px;到你的TD风格。这通常不会对Outlook 2013年

0

的伎俩这应该工作:

<table width="600" align="center" cellspacing="0" cellpadding="0"> 
    <tr> 
     <td width="100%" style="font-size: 0; mso-line-height-rule: exactly; line-height: 0;" bgcolor="#ed5d98"> 
      <table width="100%" cellspacing="0" border="0" cellpadding="0" align="center"> 
       <tr> 
        <td width="100%" valign="bottom" style="font-size: 0; mso-line-height-rule: exactly; line-height: 0;" bgcolor="#ffffff"> 
         <img width="600" src="https://eoa-editor.s3.amazonaws.com/f90c5762a5514d4fa25ece7946c98bfd37feee58%2Fframe.png" alt"" style="display: block;"> 
        </td> 
       </tr> 
      </table> 
     </td> 
    </tr> 
</table> 
  • 添加font-size: 0; mso-line-height-rule: exactly; line-height: 0;<td> s到执行确切的行高度
  • 添加display: block;<img>否定额外的行高度
  • 删除了<table><td>的几个重复属性