自定义字体没有显示在电子邮件中
问题描述:
我在电子邮件中使用下面的代码来导入字体'Open sans',但仅向用户显示已经在其系统中已经有字体的用户,否则显示字体。自定义字体没有显示在电子邮件中
@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;
}
我做错了什么?
答
自定义字体是not supported in all email clients。目前无法在Outlook,Gmail应用程序或任何Webmail客户端中显示网页字体。请注意,回退系统字体将显示在某些电子邮件客户端中,而不管电子邮件中编码的是什么。
但是,您可以为客户指定一个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]-->
更多关于web字体支持在电子邮件上Style Campaign和Litmus。
你正在寻找什么邮件客户端?大多数电子邮件读者使用20世纪90年代的HTML引擎 –