Results 1 to 4 of 4

Thread: Help needed with class="current"

  1. #1
    Join Date
    Sep 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help needed with class="current"

    http://www.dynamicdrive.com/style/cs...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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In the case of <li class="current"> the selector should be:

    Code:
    .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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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
    Code:
    .droplinebar ul li.current a
    I would like to have this thread marked as resolved, can you or anyone else do that?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •