Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong><em>Updated 2018 for Bootstrap 4</em></strong></p> <p>Changing the Navbar color is different (and a little easier) in Bootstrap 4. You can create a custom navbar class, and then reference it to change the navbar without impacting other Bootstrap navs..</p> <pre><code>&lt;nav class="navbar navbar-custom"&gt;...&lt;/nav&gt; </code></pre> <hr> <p><strong>Bootstrap 4.0</strong></p> <p>I know the original question was for 3.x, but I thought a new Bootstrap 4 example would be helpful too. The CSS required is much less in Bootstrap 4...</p> <pre><code>.navbar-custom { background-color: #ff5500; } /* change the brand and text color */ .navbar-custom .navbar-brand, .navbar-custom .navbar-text { color: rgba(255,255,255,.8); } /* change the link color */ .navbar-custom .navbar-nav .nav-link { color: rgba(255,255,255,.5); } /* change the color of active or hovered links */ .navbar-custom .nav-item.active .nav-link, .navbar-custom .nav-item:hover .nav-link { color: #ffffff; } </code></pre> <p><a href="http://www.codeply.com/go/1ZFF5CEXM5/custom-navbar-color" rel="noreferrer">Bootstrap 4 Custom Navbar Demo</a><a href="https://i.stack.imgur.com/6cUsa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6cUsa.png" alt="enter image description here"></a></p> <hr> <p><strong>Bootstrap 3</strong></p> <pre><code>&lt;nav class="navbar navbar-custom"&gt; &lt;div class="navbar-header"&gt; &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt;... &lt;/button&gt; &lt;a class="navbar-brand" href="#"&gt;Title&lt;/a&gt; &lt;/div&gt; ... &lt;/nav&gt; .navbar-custom { background-color:#229922; color:#ffffff; border-radius:0; } .navbar-custom .navbar-nav &gt; li &gt; a { color:#fff; } .navbar-custom .navbar-nav &gt; .active &gt; a { color: #ffffff; background-color:transparent; } .navbar-custom .navbar-nav &gt; li &gt; a:hover, .navbar-custom .navbar-nav &gt; li &gt; a:focus, .navbar-custom .navbar-nav &gt; .active &gt; a:hover, .navbar-custom .navbar-nav &gt; .active &gt; a:focus, .navbar-custom .navbar-nav &gt; .open &gt;a { text-decoration: none; background-color: #33aa33; } .navbar-custom .navbar-brand { color:#eeeeee; } .navbar-custom .navbar-toggle { background-color:#eeeeee; } .navbar-custom .icon-bar { background-color:#33aa33; } </code></pre> <p><a href="http://bootply.com/78010" rel="noreferrer">Custom Navbar Demo on Bootply</a></p> <hr> <p>If the Navbar has dropdowns, add the following to change dropdown color(s):</p> <pre><code>/* for dropdowns only */ .navbar-custom .navbar-nav .dropdown-menu { background-color: #33aa33; } .navbar-custom .navbar-nav .dropdown-menu&gt;li&gt;a { color: #fff; } .navbar-custom .navbar-nav .dropdown-menu&gt;li&gt;a:hover,.navbar-custom .navbar-nav .dropdown-menu&gt;li&gt;a:focus { color: #33aa33; } </code></pre> <p><a href="http://www.bootply.com/Iq82PS84ZA" rel="noreferrer">Demo with Dropdown</a></p> <hr>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload