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

Equally spread ul links of different widths

  • # March 15, 2012 at 1:06 pm

    How can I equally spread links in a ul that have different widths? What’s the best way to have full control with the padding or margin?

    # March 15, 2012 at 1:51 pm

    You mean like this?

    Otherwise you could use some jQuery to grab the width of the text and alter the padding for each one that way.

    # March 15, 2012 at 2:22 pm

    add these:

    #menu {
    float: left;
    position: relative;
    left: 50%;

    #menu li {
    position: relative;
    left: -50%;
    # March 15, 2012 at 7:27 pm

    Thanks to both of you. Is there a way to resolve this thread?

    # March 15, 2012 at 8:50 pm

    yup, click edit on your original post and there’s a checkbox to mark as solved :)

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

You must be logged in to reply to this topic.