首页 文章

在玉器中,无法获得@ font-face的风格

提问于
浏览
1

从一个工作的CSS文件(由font-squirrel生成):

@font-face {
  font-family: 'SnowTopCaps'; 
  src: url('/fonts/snowtopcaps-webfont.eot'); 
  src: url('/fonts/snowtopcaps-webfont.eot?#iefix') format('embedded-opentype'),
    url('/fonts/snowtopcaps-webfont.woff') format('woff'),
    url('/fonts/snowtopcaps-webfont.ttf') format('truetype'),
    url('/fonts/snowtopcaps-webfont.svg#snowtopcaps') format('svg');
  font-weight: normal;
  font-style: normal;
}

试图在 jade 文件的 style 部分声明:

...
style
  @font-face
    font-family
      | SnowTopCaps
    src
      | url('/fonts/snowtopcaps-webfont.woff') format('woff')
    font-weight
      | normal
    font-style
      | normal
    ...

style 声明都没有写入生成的 html

有谁看到这里缺少什么?

1 回答

  • 2

    此语法适用于HTML,而不适用于css . 使用

    style.
      @font-face {
        font-family: 'SnowTopCaps'; 
        src: url('/fonts/snowtopcaps-webfont.eot'); 
        src: url('/fonts/snowtopcaps-webfont.eot?#iefix') format('embedded-opentype'),
          url('/fonts/snowtopcaps-webfont.woff') format('woff'),
          url('/fonts/snowtopcaps-webfont.ttf') format('truetype'),
          url('/fonts/snowtopcaps-webfont.svg#snowtopcaps') format('svg');
        font-weight: normal;
        font-style: normal;
      }
    

    或者使用:手写笔过滤器

相关问题