Solved

li menu

Posted on 2013-01-23
5
194 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

770 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