Change the link color nav bootstrap 4

0

I have the menu below:

ButIwouldlikethecolorofthelinktobe#3E4095andhover#FFFF00.HowcanIchangethecolorinBootstrap4?

<navclass="navbar navbar-expand-lg navbar-light">
        <a class="navbar-brand" href="#">&nbsp;</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav" style="margin-top: 13px">
          <ul class="navbar-nav">
            <li class="nav-item">
              <a class="nav-link" href="#">Importação</a>
            </li>
            <span class="linha-vertical"></span>
            <li class="nav-item">
              <a class="nav-link" href="#">Exportação</a>
            </li>
            <span class="linha-vertical"></span>
            <li class="nav-item">
              <a class="nav-link" href="#">Curso de Instrutor</a>
            </li>
            <span class="linha-vertical"></span>
            <li class="nav-item">
              <a class="nav-link" href="#">Assessoria Jurídica</a>
            </li>
          </ul>
        </div>
        </nav>
    
asked by anonymous 15.11.2018 / 15:03

2 answers

0

I managed to solve it, but I do not have much experience with Bootstrap and if I did it wrong, please correct me.

.navbar-light .navbar-nav .nav-link {
  color: #3E4095;
}
.navbar-light .navbar-nav .nav-link:hover {
  color: #FFFF00;
}
    
15.11.2018 / 15:49
0

If you want a custom color you can do as you did by remembering that you have the text class, such as% text-danger (red), and so on with standard Bootstrap colors: / p>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">

<nav class="navbar navbar-expand-lg navbar-light">
  <a class="navbar-brand" href="#">&nbsp;</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNav" style="margin-top: 13px">
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link text-primary" href="#">Importação</a>
      </li>
      <span class="linha-vertical"></span>
      <li class="nav-item">
        <a class="nav-link text-success" href="#">Exportação</a>
      </li>
      <span class="linha-vertical"></span>
      <li class="nav-item">
        <a class="nav-link text-danger" href="#">Curso de Instrutor</a>
      </li>
      <span class="linha-vertical"></span>
      <li class="nav-item">
        <a class="nav-link text-warning" href="#">Assessoria Jurídica</a>
      </li>
    </ul>
  </div>
</nav>
    
15.11.2018 / 18:32