2017-05-28 51 views

回答

0

我不知道你的代码是什么样子,但你可以做这样的事情

.navbar #nav > .active > a { 
    color: red; 
} 

或目标的类或ID,但是你想

0

添加CSS伪元素::before在活动类。

您可以调整颜色和位置。下面的示例代码。

a.nav-link.active::before { 
    content: ""; 
    height: 2px; 
    width: 10px; 
    background: #000; 
    left: 25px; 
    position: absolute; 
    top: 45px; 
} 
相关问题