adding class to menu

Discussion in 'CSS' started by criminal19, Jun 10, 2010.

  1. #1
    hi
    im trying to add the class "current" from this menu
    http://www.cssplay.co.uk/menus/pro_dropline.html
    Code (markup):
    second example
    to this menu
    http://www.cssplay.co.uk/menus/pro_left_right_line.html
    Code (markup):
    appreciate any help
     
    criminal19, Jun 10, 2010 IP
  2. dlb

    dlb Member

    Messages:
    203
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #2
    Not entirely sure what you mean here...

    Do you want it to look the same or what?
     
    dlb, Jun 10, 2010 IP
  3. criminal19

    criminal19 Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes the class current show the subs automatically and thats what im trying to add to the second menu
     
    criminal19, Jun 10, 2010 IP
  4. dlb

    dlb Member

    Messages:
    203
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #4
    So you want the sub-menu to show at all times?

    If so, try the following (make sure you overwrite this existing tag in your CSS)
    .pro_linedrop .sub {
    /*
    position:absolute; left:-9999px; width:0;
    */
    }
    
    Code (markup):
    It's just commented out so the browser won't parse it.
     
    Last edited: Jun 10, 2010
    dlb, Jun 10, 2010 IP
  5. dlb

    dlb Member

    Messages:
    203
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #5
    I've actually downloaded it now so I should be able to help further.

    After looking at the markup and testing one or two things its pretty clear that it needs re-writing. Currently the menu is drawing the 'sub' for each set of sublinks, this will need to be re-written so that the 'sub' is drawn only once and the containing links are the things that change.

    Sorry but I do not have the time or will to do this for you.

    For reference CSSPlay is outdated and full of redundant markup.
     
    dlb, Jun 10, 2010 IP
  6. dlb

    dlb Member

    Messages:
    203
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #6
    It is fairly easy to do, the hardest part is the rollovers on the submenu but it is very much possible. I would try another tutorialised approach if you want to achieve this effect, or hang around and see if someone with more time can help you.
     
    dlb, Jun 10, 2010 IP
  7. johagulo

    johagulo Peon

    Messages:
    879
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I don�t understand, can�t you just do class=�current�
     
    johagulo, Jun 12, 2010 IP