【问题标题】:@font-face don't works just inline font-family@font-face 不仅仅适用于内联字体系列
【发布时间】:2014-07-08 15:44:53
【问题描述】:

我需要你的帮助,我正在尝试在 PHPMAILER 中更改电子邮件的字体,并且只识别内联 css,头部中的样式标签不起作用(我不知道为什么)。

你知道如何将@font-face 插入到 tbody 中吗?

$contenido = '<!doctype html>
    <html>
      <head>
        <style>
    @font-face {
        font-family: dinot-regularregular;
        src: url(xxxxxxxxxxxx/css/Font/dinot-regular-webfont.woff);
    }
    body {
        font-family: dinot-regularregular;
    }
        </style>
      </head>

    <body>';
$contenido .= '
<table> 
<tbody style="font-family:dinot-regularregular; font-size:16px; color:#666666;">
// Content
</tbody>
</table>';

感谢您的帮助。

【问题讨论】:

  • 不要认为这行得通。或者您可以尝试在电子邮件本身中包含字体文件。
  • 确保您的浏览器/电子邮件客户端支持嵌入字体 woff 格式...
  • @putvande 我已经尝试过了,不行。
  • @shennan 是的,可以使用普通字体,而不是像这样自定义。

标签: html css fonts phpmailer


【解决方案1】:

在电子邮件客户端的支持下,格式化的电子邮件非常挑剔。如果您阅读这篇文章,他们有一个表格显示有多少电子邮件客户端支持字体。这不是一个很高的数字。

https://www.campaignmonitor.com/blog/post/3044/does-font-face-work-in-email

【讨论】:

  • 呵呵.. 只是在看同一个网站
  • 好的,没什么可做的,非常感谢。如果我能做到这一点,你会知道的!
猜你喜欢
  • 2013-03-02
  • 1970-01-01
  • 1970-01-01
  • 2014-07-07
  • 2019-08-06
  • 2021-09-26
  • 2017-06-20
  • 1970-01-01
  • 2022-12-21
相关资源
最近更新 更多