Skip to content Skip to sidebar Skip to footer

Fix Border-bottom Menu

This is my menu: http://jsfiddle.net/FLq5c/8/ That is a link that takes you to one of those online code editors, so that you can send me the updated link with the correct code. The

Solution 1:

Your .active selector is less precise than .customnav .nav > li, which mean the .active selector is overridden by the other one (.customnav .nav > li).

Possible solutions :

.customnav .nav > li.active {
    color: #ff4e50;
    border-bottom: 2px solid #ff4e50;
    line-height: 20px;
}

or adding !important to the the property :

.active {
    color: #ff4e50;
    border-bottom: 2px solid #ff4e50 !important;
    line-height: 20px;
}

Solution 2:

Here, This works.

.customnav .nav > li {
    color: blue;
    margin: 12px 15px;
    border-bottom: 2px solid green;
}

.customnav .nav li.active {
    color: #ff4e50;
    border-bottom: 2px solid #ff4e50 !important;
    line-height: 20px;
}

The reason it didn't work was that, border-bottom: 2px solid rgba(0, 0, 0, 0.1); means it is black with opacity of 10%;

And the reason why .active couldn't alone get your border red was that css relies on priority. And In css .customnav .nav li.active will get more priority than just .active on the same element or even li.active


Solution 3:

add this

.customnav .nav > li.active {
    border-bottom: 2px solid #ff4e50;
}

Post a Comment for "Fix Border-bottom Menu"