2012-02-09 69 views
0

我不喜歡Graffonti字體,我添加了Css3,但html結果沒有顯示字體。爲什麼字體不能在Html CSS中工作?

我的CSS文件中有這樣的代碼,..

@font-face { 
     font-family: Graffonti; 
     src: url('fonts/Graffonti/graffonti.3d.drop.[fontvir.us].ttf'); 
    } 

h1,h2,h3,h4,h5,h6{ 
    margin-bottom: 21px; 
    line-height: 21px; 
    font-family: 'Graffonti',sans-serif; 
    font-weight: 400; 
    line-height: 1.2em; 
} 

字體在字體/ Graffont文件夾,。我想在我的系統中安裝字體嗎?

什麼是錯?

回答

1

我通常有字體的多個版本,允許多個瀏覽器,如果你去這裏並上傳您的字體,它生成的代碼和字體格式,爲您提供: http://www.fontsquirrel.com/fontface/generator

+0

我只有TTF文件。我做了什麼? – Sagotharan 2012-02-09 17:33:02

+0

http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax – Sagotharan 2012-02-09 17:36:12

1

是字體/文件夾中的同目錄作爲css文件?

[fonts] [images] index.html style.css 

如果字體文件夾可供通過http://domain.com/fonts/Graffonti/.../graffonti...ttf 然後將URL包括根斜線/fonts/

我還建議從字體文件名去掉括號[]和更新代碼相匹配。

src:url('/fonts/Graffonti/graffonti.3d.drop.fontvir.us.ttf');

+0

沒有它的一個單獨的文件夾。謝謝。 – Sagotharan 2012-02-09 17:31:30

0

不要忘記噴碼..

@font-face { 
    font-family: 'MyFontFamily'; 
    src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'), 
     url('myfont-webfont.woff') format('woff'), 
     url('myfont-webfont.ttf') format('truetype'), 
     url('myfont-webfont.svg#svgFontName') format('svg'); 
    } 

這個編碼可以幫助..它支持下面的瀏覽器。

的Safari 5.03,IE 6-9,火狐3.6-4,鉻8的iOS 3.2-4.2,機器人 2.2-2.3,歌劇11

+1

你爲什麼這樣說話? – benesch 2012-02-17 18:25:52

+1

喜歡什麼?...我不喜歡? – 2012-02-17 18:28:59

相關問題