Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

UL is *almost* centered. ;/

If you check out webdesignerdan.net, you'll notice that the graphic banner is centered on the page, but my navigation UL is only kind-of centered. It's centered, but more to the right. I've not been able to figure out what is pushing my centered UL a bit to the right. Also - the nav div won't remain gray, I colored it so I could verify that the contents are centered (or not so centered). Thanks in advance for any guidance you can provide!

l.nav {
margin: auto;
padding: auto;
list-style: none;
position: relative;
text-align: center;

}

ul.nav li {
margin-right: 50px;
display: inline-block;

}

ul.nav li:hover {
    background-color: #DDDDDD;

}

ul.nav li.last {
margin: 0;
display: inline-block;

2 Answers

Hey Daniel, add padding-left: 0 to the unordered list with the class of nav and this should fix the issue for you.

Thank you much! This fixed it!