当前菜单颜色CSS导航

时间:2017-03-23 17:07:04

标签: html css navigation currentitem

我在使用当前菜单项时遇到问题而且没有显示正确的颜色。

页面在这里:http://new.leicesterymca.co.uk/youth-community/our-work/youth-homelessness/我遇到的麻烦就在左侧边栏的导航栏中。

青少年无家可归 -Ambition

我们正处于青少年无家可归页面,因此“野心”菜单项目应与青年无家可归者的深蓝色相同。它应该是#8fa9ba(浅蓝色)。

如果你点击Ambition页面,两个实际上会显示我想要的......

我正在使用的CSS是:

/* ------ Menu Level 3 -------*/



.sub-nav-left {
  margin:68px 0 0 0;
  padding:0;
  font-weight: bold;
}

.sub-nav-left a {
  text-decoration: none;
  color: #2f9395;
}

.sub-nav-left a:hover {
  color: #163a52;
}

.sub-nav-left  ul {
  width: 95%;
  margin: 0;
  padding: 0;
}

.sub-nav-left li {
  margin: 0 0 0 0;
  padding: 10px 0 10px 0;
  text-indent: 0;
  border-bottom: 1px solid #e9eaeb;
}

.sub-nav-left li:before {
  content: none;
}

.sub-nav-left li:last-child {
  border-bottom: none;
}

.sub-nav-left .sub-menu li {
  text-indent: 20px;
  padding: 5px 0 0 0;
  border: none;
}

.sub-nav-left .sub-menu a {
  color: #9fcac7;
}

.sub-nav-left .sub-menu a:hover {
  color: #8fa9ba;
}






/* STYLING FOR THE CURRENT MENU ITEMS - Menu Level 3 */


/* This styles the top level parent item */
.sub-nav-left .current-menu-parent > a {
  color: #163a52;
}

/* This styles the dropdown menu current item  */
.sub-nav-left .current-menu-item a {
  color: #163a52;
}

/* This styles the sub menu */
.sub-nav-left .current-menu-item a {
  color: #163a52;
}






/* STYLING FOR THE CURRENT MENU ITEMS - Menu Level 3 - Sub */


/* This styles the top level parent item */
.sub-nav-left .sub-menu .current-menu-parent > a {
  color: #8fa9ba;
}

/* This styles the dropdown menu current item  */
.sub-nav-left .sub-menu .current-menu-item a {
  color: #8fa9ba;
}

/* This styles the sub menu */
.sub-nav-left .sub-menu .current-menu-item a {
  color: #8fa9ba;
}

1 个答案:

答案 0 :(得分:1)

较暗的颜色(#163a52)应仅适用于.current-item的直接死者,对吧?如果是这样,您可以将选择器更改为:

.sub-nav-left .current-menu-item > a代替.sub-nav-left .current-menu-item a