Possible to do submenu indicators with CSS?

Discussion in 'CSS' started by hammiesink, Mar 21, 2009.

  1. #1
    If a menu has a dropdown suckerfish-style menu hiding in it, is there a way to automatically indicate that it does with an arrow or other pointer?
     
    hammiesink, Mar 21, 2009 IP
  2. CoryR

    CoryR Active Member

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    70
    #2
    You could always just use plain-text: »

    If you wish to use an image, setup a specific selector to add the arrow as the background:

    .arrow { background: url([B][COLOR="Green"]images/arrow.gif[/COLOR][/B]) #FFF no-repeat center right; }
    Code (markup):
     
    CoryR, Mar 21, 2009 IP
  3. hammiesink

    hammiesink Member

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    But I mean automatically. If it has a submenu, display indicator, if not, then don't.
     
    hammiesink, Mar 21, 2009 IP
  4. CoryR

    CoryR Active Member

    Messages:
    68
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    70
    #4
    It'll basically be automatic when you setup a specific selector to indicate whether the menu has a submenu. I might not be understanding you entirely, though. In relation to "automatic", JavaScript sounds to be more of the path you'd want to take.
     
    CoryR, Mar 23, 2009 IP
  5. hammiesink

    hammiesink Member

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Well, I'm trying to use it with a content management system which will print the <ul> nav menu in between my divs, so I was wondering if there is a method in CSS to dynamically "know" whether the menu has subitems or not and add the indicator.

    It seems like there should be a "reverse ancestor" selection capability. If an element is a child of such and such do this, but no way to say "if an element is a PARENT of such and such, do that?"
     
    hammiesink, Mar 25, 2009 IP