【问题标题】:HTML emails - do fonts cascade?HTML 电子邮件 - 字体会层叠吗?
【发布时间】:2023-04-01 06:20:01
【问题描述】:

如果我将 Arial 指定为表格的字体,是否会向下级联为表格中所有单元格/表格的默认字体?

例如,这是否会在流行的电子邮件客户端中始终如一地工作?

<table align="left" style="font-family: Arial, sans-serif; font-size: 13px;">
  <tr>
    <td>

       <table width="100%">
         <tr>
           <td>
             Another table - would the text here still be Arial?
          </td>
        </tr>
      </table>

    </td>
  </tr>
</table>

【问题讨论】:

  • 你不能测试一下吗?

标签: html-email html4 email-templates


【解决方案1】:

刚刚在 Outlook 2013 中进行了测试,结果惨遭失败。不确定它在许多其他更好的客户端中的表现如何,但我想如果你想支持令人震惊的糟糕 Outlook,答案是在每个表格单元格上指定样式。

【讨论】:

    【解决方案2】:

    它适用于某些客户端,但不适用于所有客户端。尤其是在 Outlook 2010 和 2013 中。(宽度百分比相同)
    最好始终为每个 &lt;td&gt; 指定所需的样式和字体 如下所示:

    <table align="left" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td style="width: 100%;">
    
          <table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td style="font-family: Arial, sans-serif; font-size: 13px;">
                Another table - The text here will be formatted for all clients
              </td>
            </tr>
          </table>
    
        </td>
      </tr>
    </table>
    

    【讨论】:

      【解决方案3】:

      在每个新的表格标签中指定字体就足够了。我只是从您的初始表中复制样式值并将其重用于每个子表。

      您可以根据需要在每个 TD 上指定样式,但除非出现严重错误(或 Outlook 的新版本对此进行了更改),否则字体样式将应用于所有表格单元格,直到您输入新表格。

      类似:

      <table align="left" style="font-family: Arial, sans-serif; font-size: 13px;">
        <tr>
          <td>
             <table width="100%" style="font-family: Arial, sans-serif; font-size: 13px;">
               <tr>
                 <td>
                   Another table - would the text here still be Arial?
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      

      【讨论】:

        猜你喜欢
        • 2023-03-26
        • 2021-08-21
        • 2011-12-26
        • 1970-01-01
        • 2023-03-15
        • 1970-01-01
        • 1970-01-01
        • 2017-09-13
        • 2019-11-01
        相关资源
        最近更新 更多