2013-06-21 12 views
2

我有一個問題,我希望用戶強制使用網絡字體,而不是他的計算機上安裝的字體,因爲他們都有稍微不同的格式。我擡頭看去!important,但我不確定,當我嘗試它時,我不明白它是否工作。任何人都可以在這裏告訴我如何在@font-face上使用!important?它有效嗎?正在@ @ font-face上重要!有效嗎?

+1

如果您使用自定義字體在的'字體face'排除它開始將使用該字體,不需要重要。 –

+0

真的嗎?怎麼樣???? –

+0

從這個鏈接讀取字體規則:http://msdn.microsoft.com/en-us/library/ie/ms530757%28v=vs.85%29.aspx – falguni

回答

1

因此,像這樣:

CSS

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

} 



p { font-family: 'custom-font', Arial, sans-serif; } 

HTML

<p>Your text here</p>