Grow your CSS skills. Land your dream job.

Navigation with UL

  • # December 25, 2009 at 11:36 pm

    I’m tryingto create a navigation bar using an unordered list. I chopped up the images with pohotshop but the bar keeps having space to the left and right of the images. I need it to display as one bar. I have the li set to display inline.[attachment=0]Nav_bar.jpg[/attachment]

    # December 26, 2009 at 1:51 am

    since I cannot see your code I can only guess at what is wrong.
    The first thing I would do is change li {display:inline} to li {float:left}

    The spaces sound like a margin or padding issue. put in this line of code

    li {padding:0; margin:0;}

    if that fixes the gaps you know now that the gaps came from either padding or margin. play around with it til you figure out where it is coming from.

    If you leave that code in your CSS file it will reset the padding and margin of ever li element on your page.

    If you can link to the page with the issue or post your code I can help you more.

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".