Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7897547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:11:39+00:00 2026-06-03T08:11:39+00:00

I have a CSS vertical menu I have created code is below. (Test page

  • 0

I have a CSS vertical menu I have created code is below. (Test page is located at http://www.candyundies.com/test.php).

My problem is when you mouse over to the sub menu, the highlighted ‘li’ in the parent node is changing back to the non hover color (#297BCE). I am wanting it to stay white (#FFF) like it is when you hover. I have been going crazy trying to find what I’m doing wrong. Any ideas what I’m missing?

<style>
#categories {
 background-color:#297BCE;
 width:214px;
 height:37px;
  -moz-border-radius-topright: 8px;
  border-top-right-radius: 8px;
  -moz-border-radius-topleft: 8px;
  border-top-left-radius: 8px;
  position:absolute;
  top:67px;
  padding-top:10px;
  z-index:3;
  font: bold 15px Arial, sans-serif; color:#FFFFFF;
 }
#navigation {  position:absolute;font-size:0.75em; width:214px;top:115px;}
#navigation ul {margin:0px; padding:0px;}
#navigation li {list-style: none;} 
/* FIRST LEVEL TEXT/BACKGROUND/BORDER SETTINGS */
ul.top-level {background:#fff;}
ul.top-level li {
 font-family: arial, sans-serif;
 font-size:14px;
 font-weight:bold;
 border:1px solid #D2D2D2; border-color:#fff #A5A5A5 #A5A5A5 #A5A5A5;
background:#fff url(images/arrow.gif) no-repeat center right;
}
/* FIRST LEVEL TEXT COLOR */
#navigation a {
 display:block;
 color: #297BCE;
 cursor: pointer;
 line-height: 25px;
 text-indent: 10px;
 text-decoration:none;
 width:214px;
}
/* FIRST LEVEL TEXT HOVER COLOR */
#navigation a:hover{
 color: #FFF;
 text-decoration:none;
}
/* FIRST LEVEL HOVER BACKGROUND COLOR */
#navigation li:hover {
 background-color:#297BCE;
 position: relative;
}
#navigation li{
 background-color:#FFF;
 position: relative;
}
/* SECOND LEVEL TEXT SETTINGS */
ul.sub-level li a{
    font-family: arial, sans-serif;
    font-size:12px;
    font-weight:normal;
    background-color:#FFF;
}
ul.sub-level {
    display: none;
}
li:hover .sub-level {
    position: absolute;
    display: block;
    background: #FFF;
    border: #A5A5A5 solid;
    border-width: 1px;
/* set the sub menu flyout position here */
    left: 207px;
    top: -15px;
    z-index:10;
}
/* SECOND LEVEL TEXT HOVER COLOR */
#navigation ul li ul li a:hover{
 color:#f90;
 background-color:#FFF;
 text-decoration:underline;
}
#navigation ul ul{
    padding-top:5px;
    padding-bottom:5px;
    border-radius: 8px;
    -moz-border-radius: 8px;
    -webkit-border-radius: 8px;
     box-shadow: 0px 3px 10px #B0B0B0;
}
#navigation ul li ul li a{
 text-indent: 20px;
 line-height: 17px;
}
ul.sub-level li {
    background:#fff;
    border:1px solid #D2D2D2;
    border-color:#FFF #FFF #FFF #FFF;
    float:left;
}
</style>

<div id="categories">See All Categories</div>
<div id="navigation">
    <ul class="top-level">
        <li><a href="#">Home</a>
            <ul class="sub-level">
                <li><a href="#">Sub Menu Item 1</a></li>
                <li><a href="#">Sub Menu Item 2</a></li>
                <li><a href="#">Sub Menu Item 3</a></li>
                <li><a href="#">Sub Menu Item 3</a></li>
            </ul>
        </li>
        <li>
            <a href="#">FAQ</a>
            <ul class="sub-level">
                <li><a href="#">Sub Menu Item 1</a></li>
                <li><a href="#">Sub Menu Item 3</a></li>
            </ul>
        </li>
        <li>
            <a href="#">News</a>
            <ul class="sub-level">
                <li><a href="#">Sub Menu Item 1</a></li>
                <li><a href="#">Sub Menu Item 2</a></li>
                <li><a href="#">Sub Menu Item 3</a></li>
            </ul>
        </li>
    </ul>
</div>
</div>  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:11:41+00:00Added an answer on June 3, 2026 at 8:11 am

    You need to apply the white color to only the immediate child link when the 1st level li is hovered. So use the child selector syntax (>)

    Add this declaration to your CSS:

    #navigation li:hover > a{
        color:#fff;
    }
    

    See:
    http://jsfiddle.net/MVKLC/
    for implementation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a fairly simple vertical CSS menu based off of UL. <ul
I have this script for my CSS Vertical Menu: //Nested Side Bar Menu (Mar
I have a navigation menu on this site: http://blog.helpcurenow.org/test/redesignMockup/ where I have set the
I have created navigation menu in YUI 2.8 as below : I have also
I have a vertical CSS sprite menu. I would like to realize a (at
I have a problem with a vertical css menu with 3-level submenus.The last submenu
I have a vertical css menu that I want to convert to a dropdown.
i have created a jquery onhover vertical sliding menubar now i need to implement
I've created collapsible links for navigating my page. All menu items in my navigation
I have a side bar menu composed of ul->li->a, styled with css to look

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.