Jump to content

Having trouble with nested lists


SharkBait

Recommended Posts

this i what I have:

/* CSS */
#headerMenu li ul li ul {
   display: none;
}

#headerMenu li ul li:hover ul {
   display: block;
}

..
<!-- HTML -->
<ul id="headerMenu">
  <li>Files
     <ul>
         <li>Admin</li>
         <li>Actions
             <ul>
                <li>Add</li>
                <li>Delete</li>
              </ul> 
          </li>
       </ul>
    </li>
</ul>

 

Now the above CSS does not make the Add/Delete UL hidden and I am not sure why I am using this on Firefox for now, I knwo it wont work with IE but I want to get it working with Firefox before i get the DOM working using the Suckerfish method. 

 

Hopefully you can assume the rest of the CSS is there to space everything out properly. What is happening is that it always shows the block add/delete. It is never hidden.... :(

 

Am I doing something wrong?

Link to comment
Share on other sites

#headerMenu li ul li ul {

  display: none;

}

 

#headerMenu li ul li:hover ul {

  display: block;

}

 

You are having a "cascading" issue.

 

You are designating the tag level elements "li" and "ul" incorrectly.

 

There is no element "li:hover".

 

The only way to make it work is to use the a tags:

 

 

 

 

Try:

 

#headerMenu ul ul a:link, ul ul a:visited {

  display: none;

}

 

#headerMenu ul ul a:hover, ul ul a:active {

  display: block;

}

Link to comment
Share on other sites

you can do it in css - its only ie6 that won't get li:hover

 

try this

 

ul#headerMenu li ul li ul {

  display: none;

}

 

ul#headerMenu li ul li:hover ul {

  display: block;

}

 

sometimes you just have to put the entire cascade of elements in to get it to play ball..

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.