可以在标签中使用@fontface吗? (电子邮件签名可靠性) [英] Can @fontface be used within a tag? (for email signature reliability)
问题描述
我正在收集一个电子邮件签名来定制外观。它让我觉得,我不得不通过不一致的电子邮件客户端呈现这条路线,但是有没有办法使 @fontface
通过声明字体来应用字体到文本标签本身的风格?做标准的方式(使用标题或HTML体内的样式)不会在移动电子邮件客户端上呈现字体,尽管它在某些桌面应用程序上执行。
I am working on getting an email signature to take a custom look. It irks me that that I am compelled to go this route by the inconsistent rendering of email clients, but is there a way to make @fontface
apply fonts to text by declaring the font style within a tag itself? Doing it the standards way (either with the styling in a header or within the HTML body) does not get the font to render on mobile email clients, though it does on some desktop apps.
我尝试在标签中进行样式化。 (下面的示例)理论上,这可以起作用,但在浏览器上不会很好地出现。我应该放弃这个,还是有更好的方法,我失踪了?
为了清楚起见,这个 @fontface
语法确实适用于我,当放在正确完成的样式标签。下面是我尝试在标签中定义它,产生奇怪的结果。非字体样式可以很好地出现,但是字体可以作为 Times
而不是 Tiemann
。 (看看C
和Í
告诉他们。)
And just for clarity, this @fontface
syntax does work for me when put in a correctly done style tag. Below is my attempt at defining it within the tag which yields weird results. Non-font styling comes through nicely, but the font gets put in as Times
, not Tiemann
. (Look at the "C"
and the "Í"
to tell them apart.)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-16be-with-bom" />
<title>Untitled</title>
<meta name="generator" content="BBEdit 10.5" />
</head>
<body>
<span style="@font-face
font-family:'Tiemann';
src: url('https://dl.dropboxusercontent.com/u/35370696/font_embed/tiemannlightwebfont.eot');
src: url('https://dl.dropboxusercontent.com/u/35370696/font_embed/tiemannlightwebfont.eot?#iefix') format('embedded-opentype'),
url('https://dl.dropboxusercontent.com/u/35370696/font_embed/tiemannlightwebfont.woff') format('woff'),
url('https://dl.dropboxusercontent.com/u/35370696/font_embed/Tiemann_Light.ttf') format('truetype'),
url('https://dl.dropboxusercontent.com/u/35370696/font_embed/tiemannlightwebfont.svg#Tiemann') format('svg');
font-size:22pt;
color:#6D6D6D;
float:left;
">
DIACRÍTICA
</span>
</body>
</html>
推荐答案
短篇小说: font-
是规则。没有发生。使用外部样式表,并将其放在正确的准则和可维护性上。
Short story: font-face
is an at-rule. Not happening. Use an external style sheet and put it there for proper guidelines and maintainability.
另外,请注意, @ font-face
不仅可以在CSS的顶层使用,还可以在任何CSS中使用条件组规则。
As an aside, note that @font-face
may be used not only at the top level of a CSS, but also inside any CSS conditional-group at-rule.
- https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face
这篇关于可以在标签中使用@fontface吗? (电子邮件签名可靠性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!