Log in

View Full Version : Resolved Help needed with class="current"



salto
05-20-2011, 12:59 AM
http://www.dynamicdrive.com/style/csslibrary/item/jquery_drop_line_menu/P10/
I cannot get the 'current' class working in the above CSS menu.

It is as follows in the stylesheet

/*background of main menu bar links onMouseover*/
.droplinebar ul li a:hover, .droplinebar ul li .current{
etc
}

but when I enter <li class="current"> in any of the main menu bar list items nothing happens. Maybe the selector is wrong?

Same issue when I try to add a class="current" to the sub level menu links, for example:

.droplinebar ul li ul li .current {
color: red;
}

I have no idea how to get a class="current" working for the main and the sub level links. Help most welcome!
Thank you for your time on this matter.

jscheuer1
05-20-2011, 07:26 AM
In the case of <li class="current"> the selector should be:


.droplinebar ul li.current

with no space between li and .current. The second example looks as though it should work.

If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

salto
05-20-2011, 03:09 PM
Hi John, true, I had to leave out the space, thanks very much.
And I was told I forgot the a which is critical in this selector.
So the proper statement is

.droplinebar ul li.current a
I would like to have this thread marked as resolved, can you or anyone else do that?

jscheuer1
05-20-2011, 04:35 PM
Ah yes, if the current class is on the li, you would need that to take in an a tag that the li contained.

Anyways, I've marked the thread resolved. For future reference, on threads you start, if you go back and edit the first post, make sure you are using the advanced editor (if you're not in the advanced editor when you edit the post, there's a button to 'Go Advanced", you can then mark it resolved. It will be a dropdown choice in the 'title' field in the 'Edit Post' section.