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

  • SEARCH
  • Home
  • 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 6716559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:44:53+00:00 2026-05-26T08:44:53+00:00

I have an <li> that on hover shows a <ul> beneath it. I finally

  • 0

I have an <li> that on hover shows a <ul> beneath it. I finally got the borders aligned but now for some reason the li:hover color won’t change back when I hover off of it. What seems to be happening is that when the <ul> is active the parent <li> remains hovered according to CSS.

Here’s a jsFiddle showing what’s going on:

http://jsfiddle.net/Luryf/

When the <ul> is showing and the parent <li> isn’t being hovered over, I’d like the parent <li> to have the same background color and border color of the <li> elements within the <ul>. How can I best fix this while maintaining the border integrity of the entire <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-05-26T08:44:54+00:00Added an answer on May 26, 2026 at 8:44 am

    You could by changing

    #nav li#parent:hover {
    

    to

    #nav li#parent a:hover {
    

    Also you could then put:

    #nav li#parent:hover {
        background-color:#CCD9FF;
        border-color: #99B3FF;
    }
    

    To keep it looking consistent. http://jsfiddle.net/Luryf/4/

    update: whoops. Seems also needed to move the border-* and border-radius-* into its own. (from parent to parent a) http://jsfiddle.net/Luryf/8/

    from:

    #nav li#parent{
        background-color:#FFF;
        border-top-right-radius:5px 5px;
        border-top-left-radius:5px 5px;
        -moz-border-top-left-radius:5px 5px;
        -moz-border-top-right-radius:5px 5px;
        -webkit-border-top-left-radius:5px 5px;
        -webkit-border-top-right-radius:5px 5px;
        border-top:1px solid #FFF;
        border-right: 1px solid #FFF;
        border-left:1px solid #FFF;
    }
    
    #nav li#parent:hover{
        background-color:#CCD9FF;
        border-color: #99B3FF;
    }
    

    to:

    #nav li#parent {
        background-color:#FFF;
    }
    #nav li#parent a {
        border-top-right-radius:5px 5px;
        border-top-left-radius:5px 5px;
        -moz-border-top-left-radius:5px 5px;
        -moz-border-top-right-radius:5px 5px;
        -webkit-border-top-left-radius:5px 5px;
        -webkit-border-top-right-radius:5px 5px;
        border-top:1px solid #FFF;
        border-right: 1px solid #FFF;
        border-left:1px solid #FFF;
    }
    
    #nav li#parent:hover a {
        background-color:#CCD9FF;
        border-color: #99B3FF;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some css code that shows a background color on hover. The text
I have some images that need to change, based not only on hover, but
I have a script that shows hidden text when you hover over a div.
I have a popup system that shows a image when you hover over a
I have a django app that has a horizontal navigation. For some reason I
$(.container).hover( function(){ $(.child-1).hide(0); $(.child-2).show(0); },function(){ $(.child-1).show(0); $(.child-2).hide(0); }); A project I have requires that
I have a div that I have bound the jQuery hover event to activate
I have this code that changes the opacity of the div on hover. $(#navigationcontainer).fadeTo(slow,0.6);
I have a simple search box that it hidden until hover(over) and hides again
I have a problem with an image preview that comes up when you hover

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.