View Full Version : centering nav bar ul

12-09-2010, 09:43 PM
on this site (http://shirtsaboutnothing.com/) I can't figure out how to get the items in the top nav bar centered in the middle of the bar.

I added the following css but it had no effect:

#access {text-align:center;}
#access .menu-header ul {text-align:center;}

please advise. thanks.

12-09-2010, 09:49 PM
Hello sixrfan,
Give your ul a width and center it like this:
To center an element you need three things:

a valid DocType
an element with a width
that elements right/left margins set to auto

Try this -

#access .menu-header ul,
div.menu ul {
width: 400px;
margin: 0 auto;
list-style: none;

12-09-2010, 10:04 PM
i was close. thanks ex!