li menu

Posted on 2013-01-23
Last Modified: 2013-02-03
I have a menu made out of


Open in new window

when I hover and the submenu opens,  the hover affect happens on the second ul/li and the main tab doesn't highlite anymore.
is there a way to keep the hover on the main li and on the sub li?
Question by:rivkamak
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
LVL 53

Expert Comment

ID: 38812279
Show us your CSS or post a link to the page please.


Author Comment

ID: 38812683
LVL 53

Expert Comment

ID: 38814781
Try #nav ul:hover {background:whatever you want}

You also have a problem with the menu going behind other elements.  you should add a z-index to the ul with a high enough value to be on top.


Author Comment

ID: 38817225
If I do ul:hover , the whole ul highlites.
I want just the li that is on the second ul to have a hover state
LVL 53

Accepted Solution

COBOLdinosaur earned 500 total points
ID: 38820810
I don't follow.  I you are wanting to an li that is not being hovered to show hover when another li is being hovered it does not sound like the user is going to understand what you are doing.  AFAIK the standards still do not include a way to reference a parent or ancestor; though it has been proposed an and rejected several times because it would more than double the time required to parse CSS.


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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 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…
Suggested Courses

617 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