自定义字体未显示在电子邮件中

时间:2017-05-30 07:52:02

标签: html fonts html-email

我在电子邮件中使用以下代码导入字体' Open sans'但它只向用户显示其系统中已有字体,否则显示arial字体。

@import url('http://fonts.googleapis.com/css?family=Open+Sans:400,700,800');
    body {
        font-family: 'Open Sans', sans-serif;
    }

    table,
    td,
    tr,
    th {
        font-family: 'Open Sans', sans-serif;
    }

    h2,
    p,
    div {
        font-family: 'Open Sans', sans-serif;
    }

我做错了什么?

1 个答案:

答案 0 :(得分:1)

自定义字体为not supported in all email clients。目前无法在Outlook,Gmail应用或任何网络邮件客户端中显示网页字体。请注意,无论电子邮件中的编码是什么,都会在某些电子邮件客户端中显示回退系统字体。

但是,您可以为支持它的客户端指定webfont,为那些不支持它的客户端指定系统回退字体。在<head>中放置这样的内容可以获得最佳覆盖率:

<!-- Desktop Outlook chokes on web font references and defaults to Times New Roman, so we force a safe fallback font. -->
<!--[if mso]>
    <style>
        * {
            font-family: sans-serif !important;
        }
    </style>
<![endif]-->

<!-- All other clients get the webfont reference; some will render the font and others will silently fail to the fallbacks. -->
<!--[if !mso]><!-->
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
<!--<![endif]-->

有关Style CampaignLitmus电子邮件中的webfont支持的更多信息。

相关问题