2015-04-03 73 views
1

如何在ui.bootstrap.rating中使用Font Awesome? 我发现,当我添加state-on="'fa-star'" state-off="'fa-star-o'"和更改class="glyphicon"class="fa"在ui-bootstrap-tpls它的作品。 但我想有一个更自定义的方式来更改图标的类。在ui.bootstrap.rating中使用Font Awesome

回答

0

是的,因为你正在设置state-offstate-on是他们的推荐方式。如果您要在网页上获得很多评分,我只需创建一个自定义模板并覆盖该模板。 Here is a post custom templates

1

我有字体真棒,所以不想包括字形。

uib.bootstrap版本:1.3.3 - 2016年5月22日利用有限Glyphicons,所以这是我加入到我的CSS

.glyphicon { 
    display: inline-block; 
    font: normal normal normal 14px/1 FontAwesome; 
    font-size: inherit; 
    text-rendering: auto; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
} 
.glyphicon-star:before { 
    content: "\f005"; 
} 
/** 
copied from 
.fa-star:before { 
    content: "\f005"; 
} 
*/ 
.glyphicon-star-empty::before { 
    content: "\f006"; 
} 
.glyphicon-chevron-right:before { 
    content: "\f054"; 
} 
.glyphicon-chevron-left:before { 
    content: "\f053"; 
} 
.glyphicon-chevron-up:before { 
    content: "\f077"; 
} 
.glyphicon-chevron-down:before { 
    content: "\f078"; 
} 

即添加CSS从字体真棒4.6.3适当glyphicon名称

现在我不知道这段代码是否会破解Font Awesome的版本