Solved

li menu

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

<ul>
<li>
    <ul>
            <li></li>
      </ul>
</li></ul>

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?
0
Comment
Question by:rivkamak
  • 3
  • 2
5 Comments
 
LVL 53

Expert Comment

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

Cd&
0
 

Author Comment

by:rivkamak
ID: 38812683
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
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.

Cd&
0
 

Author Comment

by:rivkamak
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
0
 
LVL 53

Accepted Solution

by:
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.

Cd&
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

21 Experts available now in Live!

Get 1:1 Help Now