代码之家  ›  专栏  ›  技术社区  ›  Arpit Gupta

<hr>标签在outlook 2013的电子邮件模板中不起作用

  •  0
  • Arpit Gupta  · 技术社区  · 8 年前

    我开发了一个电子邮件模板。在我的电子邮件模板中,除 hr Outlook 2013中的标记。

    我有附加的图像

    我得到的结果:

    Result which i am getting

    我想要的结果:

    Result which i want

    请用合适的代码帮助我。

    3 回复  |  直到 8 年前
        1
  •  1
  •   Ted Goas    8 年前

    这个 <hr> 电子邮件客户端不一致地支持。通过使用 <table> 标签,类似于以下内容:

     <table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="background:black; height:1px;>
          <tr>
               <td style="font-size:0; line-height:0;">
                    &nbsp;
               </td>
          </tr>
     </table>
    

    看起来似乎有很多简单的代码 <小时>; ,但通过使用 <表> s

        2
  •  1
  •   Jeremy Caney Abloin    2 年前

    就我而言,Outlook 2010-2019的布局显示出奇怪的水平线。

    为了避免这种情况,此代码适用于我:

    <!--[if mso]>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" >
     <tr width="100%">                                  
      <td width="100%" style="width: 100%; border-top: 1px solid #ffffff; padding-bottom: 1px;">
      </td>
     </tr>
    </table>
    <![endif]-->
    
    <!--[if !mso]><!-->
    <hr align="left" style="border: 0px; border-top: 1px solid #ffffff; color: #ffffff; background: #ffffff; margin: 0px;"/>
    <!--<![endif]-->
    
        3
  •  0
  •   Tawab Wakil Germ    7 年前

    替代使用 <hr> 在电子邮件客户端中,以下内容产生了类似的效果,即一条细水平线:

    <div style="background: #d9d9d9; font-size: 1px; line-height: 1px;">&nbsp;</div>
    

    这已在Outlook 2016中验证为正确呈现,但在2013年也应有效。