Can't change nav-bar link's color in Bootstrap 4

白昼怎懂夜的黑 提交于 2019-12-20 05:59:29

问题


I am trying to change nav bar's one link's color while I tried all ways it still has a default color. Here is the code:

<li class="nav-item signup">
        <a class="nav-link" routerLink="/signup" >Sign Up</a>
      </li>

css

.navbar-light .navbar-nav .nav-link li a.signup {
    color:#ffffff !important;
}

I am trying to change sign up buttons link color. An interesting fact is that the background color of nav-item (.signup class) was possible to change while a link is impossible.

How can I change that a link color? What is wrong on the css?


回答1:


Your anchor has .nav-link class, your .nav-item has the custom .signup class. Where did you come up the structure of .nav-link li a.signup?

Try this:

.navbar-light .navbar-nav .nav-item.signup .nav-link {
    color:#fff;
}


来源:https://stackoverflow.com/questions/51367180/cant-change-nav-bar-links-color-in-bootstrap-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!