2014-05-14 117 views
5

我正在使用Metro UI项目与我的布局。我还增加了字体awesome到我的项目,但是当我使用metro和字体awesome在一起,也有一些问题:Metro UI CSS字体真棒

<div class="tile-content icon"> 
    <span> 
     <i class="fa fa-ticket fa-fw"></i> 
    </span> 
</div> 

我想设置fa图标进入Metro UI的称号,但是当我运行的代码,我不能看到从标题的图标:

enter image description here

如果我只添加以下内容:

<i class="fa fa-ticket fa-fw"></i> 

一切都很好...有人能帮助我吗?

回答

10

我有同样的问题。你需要“逼”的字体真棒字体:

.fa { 
    display: inline-block; 
    font-family: FontAwesome !important; 
    font-style: normal; 
    font-weight: normal; 
    line-height: 1; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
} 

此块是在font-awesome.css文件,你需要添加!important这样的Metro UI不会覆盖它。
如果你不想/可以编辑原始CSS文件,你也应该能够通过添加以下到您自己的CSS文件来解决这个问题:

.fa { 
    font-family: FontAwesome !important; 
} 

这样做的原因problme是,从一个风格Metro UI CSS确实会覆盖瓦片的font-family样式,因此默认情况下不再使用字体真棒字体。