views:

47

answers:

1

See http://bldd.nl/prototypes/megamenu/test23.php

I am stuck with this, if you rollover the submenu navigation you see the corresponding mainmenu rollover sprite?

How can i fix this and optimize the css?

A: 

Your CSS uses a descendant selector: #jobs-news a:hover.

This will match any a:hover inside of #jobs-news, even if it's actually in one of its children.

The simplest solution would be to give the root a elements their own class (eg, <a class="MainLink" href="#">), then change the hover selectors to #jobs-news a.MainLink:hover.

This way, it wouldn't match the subitems, since they wouldn't have the MainLink class.

If you don't need to support IE6, you could also use a child selector: #jobs-news > a:hover

SLaks
man, your fast.but i tried that with the second one<a href="#jobs" id="testlink"> gonna take another look and try your suggestion.tx in advance
yous
slaks, your were absolute right. i am having troubles with choosing the right selector this one work tx to you #jobs-jobs a.testlink:hover {background:url("/assets/imgs/mainmenu4.jpg") -123px -30px no-repeat; }Now i need to optimize and outline the submenu
yous
You should give the `<a>` elements a class, not an ID: `<a class="MainLink">`. You can then write `#jobs-news a.MainLink:hover`.
SLaks
@slaks, tx i have given the <a> a class="spritelink".One more question more js/jquery related. How do make sure the dropmenu stays down when you rollover the mainmenu from left to right??
yous
oh and how would li in dropdown react on longer text. li seems to be 20px height all te time?
yous