?
Solved

Styling Bootstrap 3.0 Dropdown Menu

Posted on 2014-03-27
2
Medium Priority
?
3,631 Views
Last Modified: 2014-03-29
I'm having some issues styling bootstrap's dropdown menu.
I'm trying to make the hover background color on the dropdown links #2a040f

This is my first attempt to use bootstrap, so thanks for your help.

I'm not picking the right selectors or something, because I can't get it to work.
Any suggestions?

Thanks for your help!!!

<div class="navbar navbar-default navbar-static-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" 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>
          
        </div>
        <div class="navbar-collapse collapse ">
          <ul class="nav navbar-nav ">
            <li><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
              </ul>
            </li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>

Open in new window


/* Bootstrap Mods */
.navbar{
	background-color:#000000;	
	border-bottom:none !important;
}

.nav .navbar-nav > li:hover{
	background-color:#2a040f;
}

.navbar-nav a{
	color:#FFF !important;	
	font-size:18px;
	font-family: 'Alegreya Sans SC', sans-serif !important;

}

.navbar-nav, .dropdown:active{
	background:none !important;	
}

.navbar-nav .dropdown li a{
	color:#000 !important;
}	


.navbar .nav li {
z-index: 10000;
}

.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  color: #FFF;
  background-color: #2a040f;
}

Open in new window

0
Comment
Question by:slightlyoff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
jayakrishnabh earned 2000 total points
ID: 39961035
please add this style and try

a:hover {
            background-color: #2a040f;
        }
0
 
LVL 1

Author Comment

by:slightlyoff
ID: 39963886
Thank you!  Sorry I didn't get back to this question sooner, I wasn't able to try it out until this morning.

Appreciate the help!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses
Course of the Month12 days, 13 hours left to enroll

777 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