@ font-face在IE9中不起作用

时间:2012-09-11 00:08:09

标签: css internet-explorer-9

我有以下代码来为我的页面设置字体样式,但不知何故@ font-face在mozilla中工作但在IE中没有。有谁知道这里发生了什么,我该如何解决这个问题?

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

@font-face {
  font-family: 'BebasNeue';
  src: url('../fonts/BebasNeue.otf');
  }  


.tab_g 
{
    background:url(../images/ss_tab_0.png) no-repeat;
    width:176px;
    height:42px;
    font: 25px 'TrashHand',Arial, Helvetica, sans-serif;
    font-weight:50;
    text-transform:uppercase;
    color:#ffffff;
    padding-top:10px;
    text-align:center;
    margin-bottom:-15px;
}

1 个答案:

答案 0 :(得分:5)

你绝对应该查看Font Squirrel之类的内容,你可以上传你的字体,它会吐回相应的CSS。在所有浏览器中保证完美。另外,请查看Paul Irish's bulletproof @font-face以获取有关该主题的更多信息。

看起来应该是这样的:

@font-face {
  font-family: 'Graublau Web';
  src: url('GraublauWeb.eot?') format('eot'), url('GraublauWeb.woff') format('woff'), url('GraublauWeb.ttf') format('truetype');
}