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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Joomla main HTML page 4 46
Problem to Popup 2 51
Open an ul or div with hover on a li,how? 9 21
Phone Dialer 5 36
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
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 define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now