在导航标签中添加标签的背景

时间:2018-07-19 11:26:30

标签: css

这是我的示例-css是我尝试过的。

---------------------------
- ID_A_x - name  - ID_A_y -
---------------------------
- 1      - Micha - 1      -
- 1      - Micha - 2      -
- 2      - Micha - 2      -
- 2      - Micha - 1      -
- 3      - Lea   - 3      -
---------------------------
.active::before li {
  background: yellow !important;
}

在这里,我只想为激活的选项卡(即具有活动类的选项卡)之前可用的选项卡添加背景颜色

提琴:https://jsfiddle.net/9xf5neyz/30/

2 个答案:

答案 0 :(得分:4)

解决方案在这里

Just add this css in your code.

.nav-tabs > li:not(.active) a {
    background: yellow;
}

答案 1 :(得分:0)

在您的CSS中尝试此操作。

li.active>a{
    background:yellow;
}
相关问题