2014-02-24 37 views
0

这个问题一直让我疯狂了好几个星期。我见过类似的问题herehere,但没有找到答案。尽管我可以,但有时我的同事无法在他们的IE9上看到图标字体(顺便提一句,由icomoon生成)。现在它似乎已经转换 - 同事可以看到他们,我不能。我使用本机安装的IE8为笔记本电脑供电,并且我们网站的旧版本显示的图标不会显示在我的IE9机器上。我们网站的较新版本不会在任何一个上显示图标。图标字体在不同的电脑上显示不一样

我已经准备好写一个IE9样式表,完全删除图标字体,因为对于无法看到字体的用户,IE仍然会将额外的15px左边的填充看起来偏离。

IE8

enter image description here

IE9

enter image description here

难道是在浏览器本身还是什么设置?这里是我的CSS:

@media screen { 
    @font-face { 
     font-family: 'icons'; 
     src:url('Media/fonts/icons.eot'); 
     src:url('Media/fonts/icons.eot?#iefix') format('embedded-opentype'), 
      url('Media/fonts/icons.woff') format('woff'), 
      url('Media/fonts/icons.ttf') format('truetype'), 
      url('Media/fonts/icons.svg#icons') format('svg'); 
     font-weight: normal; 
     font-style: normal; 
    } 
    [data-icon]:before { 
     font:normal normal normal 1em/0 'icons'; speak:none; text-transform:none; 
     -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; 
    } 
    [data-icon="search"]:before  { content:"\e601"; } 
    [data-icon="downarrow"]:before { content:"\e602"; } 
    [data-icon="forms"]:before  { content:"\e603"; } 
    [data-icon="contact"]:before { content:"\e604"; } 
} 

回答

0

我解决了我自己的问题,因为我在打字几周后就打出了这个问题。由于我没有在任何地方找到这个答案,我认为这是值得在这里记录。

问题在于将CSS放入@media查询:@media screen {}。我刚刚删除了该查询,现在我的字体似乎正在工作。

我希望这可以帮助任何可能在这个问题上磕磕绊绊的人。虽然我仍然不确定为什么我的同事的安装和我的安装之间存在差异,所以如果任何人都可以放光,那会很棒!

相关问题