如何覆盖现有的 Bootstrap 类
btn
和 active
类名是从 Bootstrap 自动添加的。我想要插图上的特定颜色。
<div class="categories">
<label class="ng-binding">Categories</label>
<div class="btn-group" data-toggle="buttons">
<label class="btn active">
<input type="radio" name="cat" id="rbOption1"> Cat 1
</label>
<label class="btn">
<input type="radio" name="cat" id="rbOption2"> Cat 2
</label>
</div>
</div>
我一直在尝试这样做,但没有积极的结果
.categories label#active {
box-shadow: inset 0 3px 5px blue !important";
}
最佳答案
根据我对这个问题的理解,这是你必须做的才能覆盖 Bootstrap 样式。
.categories .btn.active {
box-shadow:inset 0 3px 5px blue;
}
如果您想在整个应用程序或页面中使用相同的样式,
.btn.active {
box-shadow:inset 0 3px 5px blue;
}
关于html - 如何覆盖 Bootstrap 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45122925/