简体   繁体   English

在引导程序中更改文本颜色

[英]Changing the text color in bootstrap

I'm making a navbar in Wordpress with bootstrap. 我正在使用Bootstrap在Wordpress中创建导航栏。 Now I want to change the color of the text. 现在,我想更改文本的颜色。 I suppose that is under "a". 我想那是在“ 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-default .navbar-nav>li>a {
    color: #fff;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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