Treehouse: Grow your CSS skills. Land your dream job.

li elements won’t display as block

  • # May 8, 2013 at 7:24 am


    I have a nav menu as follows

    And I can’t get it to display each nav element on a new line. I have set it to display block. Firebug shows both the li and the ` `elements with display: block applied

    Any ideas? They are being rendered inline

    # May 8, 2013 at 7:40 am

    The default behaviour of a ul would be to show the li’s on a new line as you desire… if they are positioned horizontally then a float must have been applied at some point. Are you editing someone elses code?

    I can’t see any nav on the link you’ve supplied so it’s hard to tell.

    # May 8, 2013 at 7:40 am

    We’d need to see the CSS.

    Also, you really don’t need that div inside the nav

    # May 8, 2013 at 8:17 am

    There’s a hell of a lot of classes and an id on each of those li’s (and the bottom 2 are missing the closing tag) – do they need that many classes on such a simple nav?

    As Paulie_D says – need to see the CSS relating to all of those class names. I imagine there is a float: left somewhere.

    # May 8, 2013 at 8:37 am

    Those classes are thanks to WordPress, aren’t they?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.