Wordpress change color background of active and hover li

admin

Administrator
Staff member
Code:
Navbar > li > a
is not working in my wordpress. I tried to use
Code:
#nav > li > a
to change the color and background of its
Code:
li
.<br>
And my main problem is I cannot change the class active of my home link, can someone post a sample on how to change this?

code is here thank you very much!

Code:
&lt;nav class="navbar navbar-default" role="navigation" id="nav"&gt;
    &lt;div class="container"&gt;
        &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
        &lt;div class="navbar-header"&gt;
          &lt;button type="button" class="navbar-toggle" data-toggle="collapse" 
                  data-target="#bs-example-navbar-collapse-1"&gt;
            &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;/button&gt;
          &lt;a class="navbar-brand" href="&lt;?php echo home_url(); ?&gt;"&gt;
              &lt;img src="http://conlinscoffee.com/wp-content/uploads/2017/05/conlins_logo.png" 
                   class=" img-responsive" alt="logo"&gt;
          &lt;/a&gt;
        &lt;/div&gt;  
        &lt;?php
        wp_nav_menu( array(
            'menu'              =&gt; 'primary',
            'theme_location'    =&gt; 'primary',
            'depth'             =&gt; 2,
            'container'         =&gt; 'div',
            'container_class'   =&gt; 'collapse navbar-collapse',
            'container_id'      =&gt; 'bs-example-navbar-collapse-1',
            'menu_class'        =&gt; 'nav navbar-nav',
            'fallback_cb'       =&gt; 'WP_Bootstrap_Navwalker::fallback',
            'walker'            =&gt; new WP_Bootstrap_Navwalker())
            );
        ?&gt;
        &lt;div class="pull-right" id="searchbar"&gt;
            &lt;?php dynamic_sidebar( 'top-menu' ); ?&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/nav&gt;