...

View Full Version : centering nav bar ul



sixrfan
12-09-2010, 10: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.

Excavator
12-09-2010, 10: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;
}

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum