?
Solved

HTML Menu bar background color

Posted on 2014-10-13
6
Medium Priority
?
228 Views
Last Modified: 2014-10-14
I've got a web page that I am updating.  One of the things I am doing is adding a horizontal menu bar.  The bar is in place and works fine, but the background color wont set as desired.  The menu items background is correctly set to #69F, but the rest of the horizontal stripe across the page is not.  It stays #FFF instead of #69F.  It is midnight and I'm sure it is something really stupid simple, and I'm going to slap myself, but what am I doing wrong?

Here is the CSS:
#hmenubar > div
{
    width: 100%;
    height: auto;
    background-color: #69F;
    margin: 0 0 3em 0;
    margin-top: 0px;
	margin-right: 0px;
    text-align: center;
    float: none;
}

.hmenu ul {
    background: #69F;
    background-color: #69F;
}

.hmenu a {
    text-decoration: none;
    text-align: center;
    color: #00F;
    background: #69F;
    background-color: #69F;
    width: auto;
    height: auto;
    margin: 0px 0px 0px 0px;
    /*margin: 0 0 3em 0;*/
    /*margin: 0px auto;*/
    font-size: 18px;
    float: none;
    padding: 8px 8px 8px 8px;
    border-top: 3px solid #ccc;
    border-bottom: 3px solid #ccc; 
    display: inline-block;
}

.hmenu li { 
    display: inline; 
    /*padding: 10px; */
    background: #69F;
    background-color: #69F;
    margin: 0px auto;
}

.hmenu a:hover {
    color: #00F;
    background-color: #F88017;
    border-bottom: 3px solid black;
    margin: 0px auto;
}

.hmenu a:active {
    color: #00F;
    background-color: #F88017;
    background: #69F;
    background-color: #69F;
    border-bottom: 3px solid black;
    margin: 0px auto;
}

Open in new window

And Here is the HTML code:
        <div class="hmenubar" >
            <center>
                <ul class="hmenu">
                    <li><a href="index.html">Home</a></li>
                    <li><a href="aboutUs.html">About Us</a></li>
                    <li><a href="services.html">Services</a></li>
                    <li><a href="plans.html">Plans</a></li>
                    <li><a href="reviews.html">Reviews</a></li>
                    <li><a href="careers.html">Careers</a></li>
                    <li><a href="blog.html">Blog</a></li>
                </ul>
            </center>
        </div> <!-- End DIV hmenubar -->

Open in new window


Thanks.
0
Comment
Question by:cef_soothsayer
[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
  • 3
  • 2
6 Comments
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 40379222
You are adding the background to the <a> and <li> elements if you want the "stripe" along the top to have a background you need to give a background colour to your <ul>

ul {
  background: #69f;
}

Open in new window

0
 
LVL 1

Author Comment

by:cef_soothsayer
ID: 40379632
I'm already using this code, it that not sufficient?
I have other UL in the site that I don't want to background color.

.hmenu ul {
    background: #69F;
    background-color: #69F;
}

Open in new window

0
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 2000 total points
ID: 40379684
That should be

ul.hmenu

Open in new window


The way you have it is you are referring to child <ul> elements of elements with the .hmenu class.
0
 
LVL 1

Author Closing Comment

by:cef_soothsayer
ID: 40379717
Awesome, thanks!
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 40379735
You are welcome - thanks for the points.
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…
Suggested Courses

770 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