SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Madison, WI
    34 Post(s)
    2 Thread(s)

    Dropdown menu best practice...

    Is there a way to mark a an LI that CONTAINS a UL w/o deliberately adding a class or ID to it?

    I have a multi-level collapsing menu. Some of the the levels sub have sub-levels and I think it would be a good UI practice to indicate that somehow. Because I try to write lean code and because there was actual no page for a header level ( a level with sub-levels) to go to directly, there is no anchor tag as a direct child of the UL, not that I think it would matter for what I am asking.

    Suggestions appreciated, as always.

  2. #2
    SitePoint Zealot PatrickSamphire's Avatar
    Join Date
    Jul 2006
    0 Post(s)
    0 Thread(s)
    If I understand you right, you're essentially looking for some kind of parent selector? E.g., if LI is a parent of UL then apply some styling?

    As far as I know there's no way of doing that with CSS, but I know there are more expert CSS people here.

    You could certainly do it with javascript, but that seems worse than adding a class.


Posting Permissions

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