Jump to content

Question on using CSS menuing with unorganized lists and the a tag


jayhawker

Recommended Posts

I have a menu that is derived with CSS and an unorganized list as such:

 

<ul>

      <li id="li1"><a href="#" id="mainMenu1" accesskey="1" title="" class="menuItem1">1</a></li>

      <li id="li2"><a href="#" id="mainMenu2" accesskey="2" title="" class="menuItem2">2</a>

            <ul>

                    <li id="li2a"><a href="#" id="mainMenu2" accesskey="2" title="" class="subMenuItem1">2a</a></li>

            </ul>

      </li>

      <liid="li3"><a href="#" id="mainMenu1" accesskey="3" title="" class="menuItem3">3</a></li>

</ul>

 

When a user hovers over li2 , I have hover css for both the list item (li2) and the a link (menuItem2) working fine.  For this particular purpose I want to have different CSS attributes for the li and a tags when hovered over.

 

When I hover over menuItem2 down to the sub menu item (subMenuItem2), the css hover attributes applied to the higher level li (li2) stay, but the they disappear for the a link (subMenuItem1) defaulting back to the default a CSS attributes.

 

What do I do in CSS to have the attributes stick for the a tag in this particular situation when hovering over a lower level list item?

 

Thanks

Link to comment
Share on other sites

have a read on the son of suckerfish menu.

 

als you markup is a bit sloppy, you have for instance

<liid="li3">  make that <li id="li3">

 

besides that the identifiers you use in your description ar not see in the code you supplied.

So best tip, check out the son of suckerfish menu, as far as I know the best menu there is.

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.