SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast dziner's Avatar
    Join Date
    Jun 2004
    Location
    Harrisburg
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Styling List within a List

    I've run into a problem with content that consists of a list within a list. For example:

    HTML Code:
    <ul>
    <li>List item one</li>
    <li>List item two
    <ul>
    <li>List item two sub-item one</li>
    <li>List item two sub-item two</li>
    <li>List item two sub-item three</li>
    <li>List item two sub-item four</li>
    </ul></li>
    <li>List item three</li>
    <li>List item four</li>
    </ul>
    The problem I'm running into is that if I style the ul with a font size of .7em, the second ul becomes very small text. This is the original css for the element:

    HTML Code:
    #mainContentBlock ul {
    font-size: .7em;
    }
    I've tried the following:

    HTML Code:
    #mainContentBlock ul ul {
    font-size: .7em;
    }
    And I've tried:

    HTML Code:
    #mainContentBlock ul li ul {
    font-size: .7em;
    }
    None of which work. None of my css and web standards books cover this topic, so I'm turning to you guys! What do I need to add so that both ul font sizes are the same?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Or more simply
    Code:
    ul ul{font-size:100&#37;}


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
  •