html - 字体适用于 IE,但不适用于 Firefox 或 Chrome

标签 html css google-chrome internet-explorer firefox

我在制作的网站中遇到字体显示问题。我使用的是 ErasITC Light 字体。相关的 HTML 是:

<div class="heading">
<div class="container-fluid">
    <h1>make your voice heard</h1>
    <h2>it's time to let the people speak out</h2>
</div>

相关的 CSS 是:

.heading h1{
font-family: ErasITC, Eras Light ITC, sans-serif;
color: #ffffff;
font-size: 6.25vw;
font-weight: 300;
text-shadow: 2px 2px 15px black;
text-align:center;
margin-top: 21vh;

}

.heading h2{
    font-family: ErasITC, Eras Light ITC, sans-serif;
    color: #ffffff;
    font-size: 2.7vw;
    font-weight: 300;
    text-shadow: 2px 2px 10px black;
    text-align:center;
}

这在 IE 中有效,但在 Chrome 或 Firefox 中无效,它显示默认的 Sans-Serif 字体。

注意:我对某些元素使用 Bootstrap 。

谢谢,

格芬亚伯拉罕。

最佳答案

当您使用空格作为字体名称时,您必须将它们放在引号中,如下所示:

font-family: "Eras ITC", "Eras Light ITC", Sans-Serif;

关于html - 字体适用于 IE,但不适用于 Firefox 或 Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29820478/

相关文章:

css - 自定义 horiz.menu CSS 底部边框技巧?需要

html - Firefox 和 Chrome 上的不同布局

css - 在 Vaadin 应用程序中应用 Css 样式

html - 如何将表格和文本放入 div 中?

PHP:随机加载 3 个 html 片段之一

html - 如何选择没有特定类的所有其他元素?

javascript - Chrome 自动填充/自动完成没有密码值

javascript - executescript chrome 扩展无法正确执行

javascript - 是否有可能捕获 net::ERR_BLOCKED_BY_CLIENT?

html - 使用 CSS 切换按钮