简体   繁体   中英

Changing the text color in bootstrap

I'm making a navbar in Wordpress with bootstrap. Now I want to change the color of the text. I suppose that is under "a". But I don't know where I need to begin. Here's my code so far:

<nav style="background-color: #C6A970 !important;" class="navbar navbar-default" role="navigation">
  <!-- Brand and toggle get grouped for better mobile display -->
  <div class="navbar-header">

    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a>
  </div>

  <!-- Collect the nav links, forms, and other content for toggling -->
  <div class="collapse navbar-collapse">
<?php wp_nav_menu( array('menu' => 'Main', 'menu_class' => 'nav navbar-nav navbar-left', 'depth'=> 3, 'container'=> false, 'walker'=> new Bootstrap_Walker_Nav_Menu)); ?>
  </div><!-- /.navbar-collapse -->
</nav>

At the end the code collects the menu items from the menu section in bootstrap. But what section do I need to edit?

You're looking to override the bootstrap template with the following:

.navbar .navbar-nav > li > a {
    color: #fff;
}

It's behavior depends navbar-default class, so you may change it by this way:

.navbar-default .navbar-nav>li>a {
    color: #fff;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM