2012-03-26 105 views
4

在CSS中使用@font-face來使用自定義字體時,我可以指定字體的相對路徑。說我有以下結構:相對路徑可以用於@ font-face src嗎?

WebContent 
- css 
    |- style01.css 
    |- style02.css 
    |- ... 
- fonts 
    |- font01.ttf 
    |- font01.ttf 
    |- ... 
- images 
    |- ... 
- js 
    |- ... 
- index.html 
- *.html 

我可以指定類似於:

@font-face { 
    font-family: 'font one'; 
    src: url('../fonts/font01.ttf'); 
} 

,因爲上述似乎不工作。

回答

4

似乎問題在於它不喜歡名稱周圍的單引號'