Solved

bootstrap navgrid css style

Posted on 2014-10-28
1
424 Views
Last Modified: 2014-11-04
I'm working on a menu toolbar using bootstrap 3.1.1
So i create an example.

This is the example for my code.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <title>Navbar Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" />

    <style type="text/css">
        
        body {
            background-color: #c2d7ce;
        }

        /* the style for Page Title Text*/
        .PageTitle {
            color: white;
            font-size: 30px;
            font-family: Arial;
            font-weight: bold;
            margin-left: 15px;
            margin-top: 2px;
            width: auto;
        }

        /*********** Bootstrap Overrides ***********/
        .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
            color: #ff61fc  /*Sets the text hover color on navbar*/
        }
        .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active >   
        a:hover, .navbar-default .navbar-nav > .active > a:focus {
            color: white; /*BACKGROUND color for active*/
            background-color: #030033; 
        }

        .navbar-default {
            background-color: #0f006f;
            border-color: #030033;
        }
        .dropdown-menu > li > a:hover,
        .dropdown-menu > li > a:focus {
            color: #262626;
            text-decoration: none;
            background-color: #66CCFF;  /*change color of links in drop down here*/
        }
        
        .nav > li > a:hover,
        .nav > li > a:focus {
            text-decoration: none;
            background-color: silver; /*Change rollover cell color here*/
        }
        
        .navbar-default .navbar-nav > li > a {
            color: white; /*Change active text color here*/
        }
        
        /*********** Bootstrap Overrides ***********/
        
    </style>
    
</head>
<body>

    <div class="container">

      <!-- Static navbar -->
      <div class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <!--<a class="navbar-brand" href="#">Project name</a>-->
            <a href="http://www.bing.com"><img src="https://farm6.staticflickr.com/5604/15652632185_4453bd0e7a_o_d.png" /></a>
          </div>

          <div class="navbar-collapse collapse">
            
            <!-- ********  items on left side of toolbar  ******** -->
            <ul class="nav navbar-nav">
              <!--<li class="active"><a href="#">Link</a></li>-->
              <li class="PageTitle">Home Page</li>
              <!--<li><a href="#">Link</a></li>-->

            </ul>
            <!-- ********  items on left side of toolbar  ******** -->
            <!-- ********  items on right side of toolbar  ******** -->
            <ul class="nav navbar-nav navbar-right">
              <li><a href="./">Link 1</a></li>
              <li><a href="../navbar-static-top/">Link 2</a></li>
              <li><a href="../navbar-fixed-top/">Link 3</a></li>
            </ul>
            <!-- ********  items on right side of toolbar  ******** -->

          </div>
          <!--/.nav-collapse -->

        </div><!--/.container-fluid -->
      </div>

    </div> <!-- /container -->

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    
    <!--<script src="../../dist/js/bootstrap.min.js"></script>-->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js"></script>
 
</body>
</html>

Open in new window


When I run it, it looks like this video:  http://youtu.be/AsyXdfMa9wM

If you notice the toolbar background color is like a purpleish/blue color with this code #0f006f .
When I resize the browser window the bootstrap hamburger menu pops up on the toolbar.
Then if I click on the hamburger menu icon then the collapsible menu opens up and it has the same purpleish/blue background color as the header toolbar.

If you look at my code.. i'm setting the background color like this in my css.

        .navbar-default {
            background-color: #0f006f;
            border-color: #030033;
        }

But when I change it here seems it to apply it to both the header background and the collapsible menu background:

Right now when I click on the hamburger menu the collapsible menu that opens up looks like this:

my existing menu
Is there a way to revise it so the header toolbar is background-color: #0f006f; and the background of the collapsible toolbar is background-color: #c6c6c6;

So I want it to look like this:

my desired colors
Here is a fiddle of my current menu:

http://jsfiddle.net/3x7y563h/

Anyone know how I can change that collapsible menu color to #c6c6c6 so it looks like the picture above?
0
Comment
Question by:maqskywalker
1 Comment
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40409512
.navbar-collapse.collapse {
    background:  #c6c6c6;
}

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now