css - @fontface css字体路径似乎不起作用

标签 css twitter-bootstrap-3

我有一个名为 project 的目录,其中有目录 htmlassetsjavascript。 Assets 目录有目录fontscsscss目录有一个名为typography的css文件.css。字体目录包含我正在使用的所有字体。

html目录中我有一个文件typography.html。要使用字体,我在 typography.css 中使用此代码,该代码在我的 html 文件中正确链接/引用。但是 typography.css

中的此代码
@font-face {
    font-family: "LatoLight";
    src: url('../fonts/lato-light-webfont.eot') format("embedded-opentype"), url('../fonts/lato-light-webfont.woff') format("woff"), url('../fonts/lato-light-webfont.ttf') format("truetype"), url('../fonts/lato-light-webfont.svg') format("svg");
    }
    h1{ font-family: LatoLight !important; }

没有产生预期的结果。我正在使用 twitter bootstrap 3。为什么这不起作用?

最佳答案

尝试:

@font-face {
    font-family: 'LatoLight';
    src: url('../fonts/lato-light-webfont.eot') format("embedded-opentype"), 
         url('../fonts/lato-light-webfont.woff') format("woff"), 
         url('../fonts/lato-light-webfont.ttf') format("truetype"), 
         url('../fonts/lato-light-webfont.svg') format("svg");
    font-weight: normal;
    font-style: normal;
}

我已将双引号改为单引号。它可能会有所不同,但我不确定。

否则这可能会有所帮助 Bootstrap 3 unable to display glyphicon properly我知道它是字形,但 Firefox 可能只是遇到其他字体的问题。

关于css - @fontface css字体路径似乎不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19176315/

相关文章:

javascript - 将输入集中在模态显示上

javascript - 灯箱画廊串联起来

html - Div 重叠 Bootstrap 列

html - Bootstrap 字体很棒的图标在下载的 CSS 中不起作用

php - 使用 php/javascript 在链接上提交表单

javascript - 使用 vanilla JS 突出显示事件选项卡

css - 标签悬停、事件和访问不起作用

javascript - 如何使导航中的某些链接不隐藏在移动设备上? Bootstrap 3

javascript - 带有 overflow-y 的 jQuery 轮播显示容器外的弹出窗口

jquery - 使 div 背景图像重复其中的源文件