如何在antennaio jquery-bar-rating中设置颜色和大小。默认颜色为蓝色。我无法在文档中以及documentation页面和github页面中找到它。也尝试过搜索。找到整个页面,但如果没有提到尺寸和颜色那么。
<select class="rating-stars" id="rating-stars" name="rating-stars" style="font-size: 20px">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
$('.rating-stars').barrating({
theme: 'fontawesome-stars-o',
});
最后我得到了一个 解: 覆盖css
.br-theme-fontawesome-stars-o .br-widget a{
font-size: 20px;
}
.br-theme-fontawesome-stars-o .br-widget a.br-selected:after {
color: #555;
}
.br-theme-fontawesome-stars-o .br-widget a.br-active:after {
color: #555;
}
答案 0 :(得分:1)
它很简单,您可以覆盖自定义css文件中的css
类并更改颜色,请参阅下面的演示
$(function() {
$('#example').barrating({
theme: 'fontawesome-stars'
});
});
&#13;
.br-theme-fontawesome-stars .br-widget a {
font-size: 64px !important;
}
.br-theme-fontawesome-stars .br-widget a::after {
color: #000 !important;
}
.br-theme-fontawesome-stars .br-widget a.br-selected::after {
color: blue !important;
}
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.2/jquery.barrating.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-bar-rating/1.2.2/themes/fontawesome-stars.css">
<select id="example">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
&#13;