2014-01-16 67 views
0

我想在我的網站上使用trajan pro。我有這個字體的.otf文件,並將它發送到我的ftp中的字體文件夾。它僅在internet explorer中不起作用。我如何解決這個問題?順便說一下,我試圖在網站上生成webfont工具包土耳其人性格問題發生。css fontface不能在IE中使用Trajan

這是我的css代碼;

@font-face{ font-family: trajan_reg; src: url("../fonts/TrajanPro-Regular.otf"); } 

ul.navbar-nav li a{ color: #FFF !important; font-family: trajan_reg; } 
+4

您需要使用字體的.eot格式,以便使其工作ØIE。 – arifix

+1

@Fags,如果家族名稱中有空格,只需要在'''裏面包含字符串。 – BenM

回答

4

您需要使用.eot格式的字體才能使其適用於IE。生成這裏 - the font-face generator

您的字體的版本.eot然後用它CSS-

@font-face {font-family: 'trajan_reg'; 
      src: url('../fonts/TrajanPro-Regular.eot'); 
      src: url('../fonts/TrajanPro-Regular.eot?#iefix') format('embedded-opentype'),url('../fonts/TrajanPro-Regular.woff') format('woff'),url('../fonts/TrajanPro-Regular.ttf') format('truetype');} 

ul.navbar-nav li a{ color: #FFF !important; font-family: trajan_reg; } 
+0

真的很感激:)) –