【问题标题】:HTML Table Spacing weirdness in Outlook 2010 and 2007Outlook 2010 和 2007 中的 HTML 表格间距异常
【发布时间】:2012-12-13 15:13:31
【问题描述】:

我正在编写 HTML 电子邮件通讯,但我在 Outlook 2007 和 2010 中的表格中遇到了非常奇怪的间距问题

我的代码在所有其他客户端都可以正常工作:

<table width="575" align="center" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td bgcolor="#0054a4" style="padding-left:20px; padding-right:20px; padding-top:20px; padding-bottom:20px; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px">
            <a href="http://www.lgfhfghfhfhfghf" target="_blank" style="font-family:Myriad Pro, Verdana, Georgia; font-size:30px; line-height: 34px; font-style:normal; color:#ffffff; text-decoration:none;">
                <center>
                    <span style="font-weight:bold;">register</span> for <span style="font-style:lighter;color:#fce000;">mkk</span><span style="color:#fce000; font-weight:bold;"> 56565464646 </span><span style="font-weight:normal; text-decoration:underline;">click here</span></strong>
                </center>
            </a>
        </td>
    </tr>
    <tr>
        <td bgcolor="#fce000" style="padding-left:20px; padding-right:20px; padding-top:10px; padding-bottom:15px; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px"><a href="http://www.fgdfgdg" target="_blank" style="font-family:Myriad Pro, Verdana, Georgia; font-size:30px; line-height: 30px; font-style:normal; color:#ffffff; text-decoration:none;">
                <center>
                    <span style="font-style:lighter;color:#0054a4;">lll</span><span style="color:#0054a4; font-weight:bold;"> ffgfgf </span><span style="font-weight:normal; color:#000000; text-decoration:none;">is proudly sponsored by</span></strong>
                </center>
            </a></td>
    </tr>
    <tr>
        <td bgcolor="#0054a4" style="padding-left:0px; padding-right:0px; padding-top:0px; padding-bottom:0px; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px">
            <a href="http://www.gdfgdfgdf" target="_blank"><img name="fgdgfg" src="http://fgfdgdgdg" width="575" height="76" style="font-size:20px; color:#fce000;" alt="fgfdgdfgdfg" border="0"/></a>
        </td>
    </tr>
</table>
<table bgcolor="#0055a5" align="center" width="575" border="0" cellspacing="0" cellpadding="10">
    <tr>
        <td align="left" bgcolor="#0055a5" valign="top">
            <img src="http://www.fdgfdgdfgdfgdf.png" height="50" width="50" alt="gggggg" align="top" border="no" style="margin-top:0px;margin-bottom:0px;margin-right:0px;margin-left:0px;padding-top:0px;padding-bottom:0px;padding-right:0px;padding-left:0px;" />
        </td>
        <td align="right" bgcolor="#0055a5" valign="top" style="margin-top:0px;margin-bottom:0px;margin-right:0px;margin-left:0px;padding-top:10px;padding-bottom:10px;padding-right:10px;padding-left:30px;font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:20px;color:#fce000;" >
            <span style="font-weight:bold;color:##fce000;" >gfrtryrtytryrtyrty</span><br />
            rtrtrtrtertretertetertertertertertertertetert <font style="text-decoration:none;">tertetertetetet</font> <a href=mailto:fgdfgdfgdgdfgfdstyle="color:#fce000; text-decoration:none;" >rtdfgdfgdfgdfg</a> / <a href="http://www.fgdfgdfgdgdgdf" target="_blank" style="color:#fce000;text-decoration:none;">www.fgfgdfgfgd/expo</a><br />
            <strong> To unsubscribe from this newsletter </strong><a href="http://$UNSUB$" style="color:#fce000; font-weight: bold; text-decoration: underline" >click here</a>
        </td>
    </tr>
</table>

诡异截图:

工作电子邮件的屏幕截图:

【问题讨论】:

    标签: outlook html-table html-email outlook-2010 outlook-2007


    【解决方案1】:

    以下是 Outlook 2007、2010 和 2013 中如何显示 HTML 电子邮件的有用列表:http://www.emailonacid.com/blog/details/C13/tips_and_tricks_outlook_07-13#outlook07-13_tip16

    该页面包含此提示,它与您编写表格的方式相符:

    避免在 TABLE 标记中使用“margin”或“padding”CSS 属性。 Cellpadding 和 Cellspacing 属性通常是安全的,但有边距 或填充通常会添加到表中的每个 TD。

    希望这有助于深入了解它。

    【讨论】:

      【解决方案2】:

      看看这个页面:

      http://www.campaignmonitor.com/css/

      他们有一个 pdf,其中包含适用于 mailclients、css、html 等的内容。

      【讨论】:

      • 嗯,这并没有真正帮助我抱歉。我真的需要知道是什么导致了间距以及如何解决它:D
      • 如果把 padding 改成 margin 会更好吗?我无法真正测试,因为我没有 Outlook 2007 或 2010 :/
      • Hm.. 如果你设置 line-height: 0px;在 TD 上,那么它可以工作吗?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-11
      • 1970-01-01
      • 2012-03-07
      • 2013-10-20
      • 2012-07-25
      • 2011-12-15
      • 1970-01-01
      相关资源
      最近更新 更多