SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot BoomPop's Avatar
    Join Date
    Aug 2001
    Location
    Missouri, USA
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quick help in editing/displaying a List Menu?



    So I'm wondering if there's any way with CSS to alter the distances (shown above with red arrows) when displaying an unordered list? I've read through several turorials and can figure out how to do just about everything imaginable, but somehow missing a solution for this...

    Thanks!

  2. #2
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good question. Yes, you can do this. You have to remember that CSS starts with a root element and then from there breaks / branches down.

    #myList li {

    padding-left:10px;

    }

    #myList li li {

    padding-left:20px;
    }


    Ok, with the basic example above, you get the idea. When you create a user defined list (as above) in the first statement the first set of list items would indent by 10px, if you create another set of list items ( a sub list of the first list ) the indentation would be 20px. Of course, you could start at the <UL> level, but I posted the above to simplify the example.
    intragenesis, llc professional web & graphic design

  3. #3
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You also need to remember that IE uses padding and other browsers use margins to indent list items, so you need to explicitly declare both.

  4. #4
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, Tyssen, good point. But, that hits on an important issue, I try to emphasize to developers to design for accessibility, otherwise you'll end up with a plethora of hacks and filters just to satisfy IE (ugh). Personally, I try to design for accessibility, simplicity, and usability -- a Lincoln is a nice ride, but, a Lincoln with three flat tires isn't much use to anyone.
    intragenesis, llc professional web & graphic design

  5. #5
    SitePoint Zealot BoomPop's Avatar
    Join Date
    Aug 2001
    Location
    Missouri, USA
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really good stuff guys. Thank you for the help. I'm sittin' pretty now.


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
  •