在litmus中测试电子邮件模板,无法弄清楚为什么Outlook2007在<strong>、<a>、<td>、<tr>标记中添加了很大的文本嵌套空间。请注意,该按钮在所有其他客户端都有效。
尝试添加各种内联CSS,比如line-height,mso-line-height:就是这样;
<!--CTA-->
    <tr>
        <td align="center">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="center" bgcolor="#009cb3" width="200" height="60" style="-webkit-border-radius: 100px; -moz-border-radius: 100px; border-radius: 100px;">
                        <a class="bg-rollover" href="" target="_blank" style="font-size:14px;font-family:Helvetica, Arial, sans-serif;color:#ffffff;text-decoration:none;padding:28px 12px;display:inline-block;width:200px;border:1px solid #009cb3;-webkit-border-radius: 100px; -moz-border-radius: 100px; border-radius: 100px;">
                        <strong style="text-transform:uppercase;">button text</strong>
                        </a>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
<!--End of CTA-->我期望输出在两行文本之间有一个小的间隔。
发布于 2019-07-23 18:32:36
决定使用VML使按钮在Outlook中工作。对于感兴趣的人,代码如下,但请注意,您必须更改VML和HTML中的href和按钮文本。
<!--CTA-->
   <tr>
      <td align="center">
         <div>
         <!--[if mso]>
            <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:60px;v-text-anchor:middle;width:200px;" arcsize="5%" strokecolor="#ffbb00" fillcolor="#ffbb00">
               <w:anchorlock/>
               <center style="color:#041857;font-family:Helvetica, Arial, sans-serif;font-size:20px;font-weight:bold;">CTA text</center>
            </v:roundrect>
         <![endif]-->
            <a href="#" style="background-color:#ffbb00;border:1px solid #ffbb00;-webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;color:#041857;display:inline-block;font-family:Helvetica, Arial, sans-serif;font-size:20px;line-height:24px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all;font-weight:bold; padding: 12px 18px;">CTA text</a>
         </div>
      </td>
   </tr>
<!--End of CTA-->虽然VML已被SVG取代,但旧版本的Outlook使用Microsoft Word呈现电子邮件。Word可以识别VML,所以如果Outlook中的内容不能像预期的那样呈现,使用VML是很有用的。
https://stackoverflow.com/questions/57114488
复制相似问题