【问题标题】:Change color of active tabs in horizontal sub-menus with css使用 css 更改水平子菜单中活动选项卡的颜色
【发布时间】:2018-06-20 00:43:50
【问题描述】:

我有嵌套的水平子菜单。我无法更改活动太阳菜单选项卡的颜色。 The first tab is color blue so when the tab is active it is changed to red.然后,当单击子菜单时,活动的子菜单应变为灰色,因此其内容。我在下面附上了 jsfiddle 链接 https://jsfiddle.net/vgjcrpud/4/

我尝试使用它的 id 访问特定的导航选项卡,但没有成功。

<style>
    .nav-tabs #submenu li.active{
            background-color: #f2f2f2;
        }
</style>

【问题讨论】:

    标签: html css


    【解决方案1】:

    要访问活动标签,您可以使用:

     #submenu > li.active > a{
       background-color: #f2f2f2;
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-04
      • 2016-07-26
      • 1970-01-01
      • 2011-04-14
      • 2023-04-05
      • 1970-01-01
      • 2016-04-12
      • 2014-06-19
      相关资源
      最近更新 更多