Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Jan
    Jan is offline
    Regular Coder
    Join Date
    Jul 2002
    Location
    Finland
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Resetting styles

    Hi there!

    I have this fairly simple problem that I hope someone could help me out with. Let's say I have a two-level menu consisting of two unsorted lists where the second one is inside the first, like so:

    Code:
    <ul id="nav">
    
       <li>Item 1</li>
       <li>Item 2</li>
       <li>
    
          Item 3
    
          <ul id="subnav">
             <li>Item 3a</li>
             <li>Item 3b</li>
             <li>Item 3c</li>
          </ul>
    
       </li>
    
    </ul>
    Now, when I apply styles to #nav, this will also affect elements in #subnav (atleast it's doing so for me). Am I doing something wrong, and if not, is there a way of resetting the styles for #subnav, so that I can create completly independent styles for it?

    Any help is greatly appreciated!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selectors

    Without seeing the styles it's guessing, but I guess you're using descendant selectors (since IE doesn't support much else) which causes some styles to effect the second level list unintentionally, though correctly.
    The only bullet-proof way would be to override the styles for the second list using the subnav id.

    If you can supply your styles, we could offer more definitve answers.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    Jan
    Jan is offline
    Regular Coder
    Join Date
    Jul 2002
    Location
    Finland
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Override, that's the word I was looking for. I actually tried overriding the styles for the second list, with successful results! Thanks a million for your assistance, Ronald.


  •  

    Posting Permissions

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