Skip to content Skip to sidebar Skip to footer

Style Navbar Toggle Bootstrap

I am working with bootstrap for the first time and am having difficulty with the navbar toggle. How do you style the toggled menu? Any help would be much appreciated. The html is a

Solution 1:

It is a bit unclear what you're asking, but you will be using CSS for styling, you should go for the with following examples:

.navbar.navbar-collapse {
   background-color: #000;
}
.navbar.navbar-collapse > .nav > li {
   color: #ddd;
   font-weight: 700;
}

Inspect your website with your browser's inspector tool (or ther developer tool included, every web browser has some on stock) by right clicking your page and selecting the inspect from the dropmenu.

Solution 2:

When you call wp_nav_menu() it renders your navigation menu list.

In wp_nav_menu() you can pass number of arguments so that you can customize your navigation menu as you want. Click here to get details about wp_nav_menu.

menu-class - The class that is applied to the ul element which encloses the menu items. You have to specify here bootstrap class.

e.g.

$args = array(
'theme_location' => 'wdm_primary',
'fallback_cb'    => false,
'menu_class'     => 'nav navbar-nav navbar-right',
'walker'         => new My_Custom_Nav_Walker,
'depth'          => 1
);
wp_nav_menu( $args );

Try it, and let me know if you are facing any difficulties.

Post a Comment for "Style Navbar Toggle Bootstrap"