我正在嘗試使用 Bootstrap-Vue 中的選項卡。我正在嘗試調整活動選項卡上的樣式。從https://bootstrap-vue.org/docs/components/tabs#active-classes的檔案中,我看到了這個更改活動選項卡樣式的示例。我知道我要修改 active-nav-item-class 屬性,如下所示:
<b-tabs
active-nav-item-class="font-weight-bold text-success"
active-tab-class="font-weight-bold text-success"
content-class="mt-3"
>
在我的 JSFiddle 中,你可以在https://jsfiddle.net/b4o1kL2f/1/看到,我同樣試圖通過將它與 Vue 系結來將 active-nav-item-class 設定為 CSS 中的類樣式:
<b-tabs pills vertical :active-nav-item-class="'tab-active-class'">
這是CSS:
.tab-active-class {
background-color: red;
}
但似乎活動標簽背景顏色沒有改變。誰能發現我可能做錯了什么?非常感謝!
uj5u.com熱心網友回復:
該類正在應用于 HTML 元素,但問題是.nav-link.active具有超過 的特異性.tab-active-class,因此您必須增加.tab-active-class
.nav-link.active.tab-active-class {
background-color: red;
}
或者
.tab-active-class {
background-color: red !important;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/358099.html
