2013-03-22 64 views
1

玉,無法獲取樣式@字體面,從一個工作的CSS文件(字體松鼠產生的)工作

 
@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; 
}  

試圖style部分申報jade文件:

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

style聲明沒有寫入生成的html

任何人都可以看到這裏缺少的東西嗎?

回答

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; 
    } 

或者使用:stylis過濾

+0

的感謝! - 我已經完全分開了'stylus:'過濾器。它只是取代'style',一切都很好 – 2013-03-23 05:02:07