ASP.NET使用非标准字体

时间:2018-02-24 06:58:12

标签: css asp.net fonts font-face

我在我的网页中使用了一种名为“Ethnocentric”的特定字体。因为这个字体还没有安装在客户端机器上,所以我在网页的样式中包含了“@@ font-face”。但是当我在PC上使用IE 10打开网站时,我知道没有安装此字体,它就会失败。我做错了什么?

@@font-face {
    font-family: "Ethnocentric";
    src: url(/ethnocentric.ttf) format("truetype"); 
}

.ethnocentricFont {
    font-family: "Ethnocentric", sans - serif;
}

Ethocentric.ttf文件位于我的wwwroot文件夹中,我引用的字体如下:

 <p class="ethnocentricFont" style="display: inline-block; color: gainsboro; font-size: 18px; text-align: left; margin: 0 auto; vertical-align: middle; margin-left: 8px;">My Heading</p>

字体在Chrome中正确显示,但在IE10中则无法显示。 我刚读过这篇文章 - 也许这就是为什么它不能在IE中工作。

StackOverFlowArticle

0 个答案:

没有答案
相关问题