更改单个菜单项上的主动链接颜色



我在我的网站菜单上创建了一个按钮,并想给它自己的个体活动链接颜色,我该怎么做?在理想的世界中,按钮将是粉红色(#ED6D8D),而活性文本颜色将为白色。当前,默认的活动菜单项颜色为蓝色(#00BCD1),因此与粉红色的碰撞会非常可怕 - 任何建议都将不胜感激!

我使用以下CSS代码创建按钮:

 #in-crisis li a:hover {opacity: 1!important;
    color: #ffffff;}
.in-crisis a {
    border: 2px solid #dbf7ff!important;
    padding: 12px!important;
    margin: 10px 12px 12px 12px;
    border-radius: 12px;
    text-align: center;
    background-color: #dbf7ff;
}
.in-crisis a:hover {
    background-color: #fff;
    color: #00bcd1!important;
    border: 2px solid #00bcd1 !important;
}
.et_header_style_left #et-top-navigation {
    padding-top: 16px!important;
}
.et_header_style_left .et-fixed-header #et-top-navigation {
    padding-top: 6px!important;
}
#main-header.et-fixed-header .in-crisis a {
color: #00bcd1 !important;
}
@media only screen and (max-width: 980px) {
.in-crisis a {
    background-color: #dbf7ff;
    }
}
@media only screen and (min-width: 980px) {
#et_top_search { 
    margin-top: 25px !important; }
}

非常感谢。

我不知道您是在谈论悬停还是活动,但对于活动CSS,您应该使用

.in-crisis a:active {
  color: white;
  //or anything else here
}

最新更新