View Full Version : How do I center an entire left-floated UL?

11-26-2008, 06:59 PM
Testing Gound (http://www.voyagercomponents.com/download/bgTest/template.php)

See the footer content. I have three rows of info, and want to center all of them.
I tried {margin:0 auto} {text-align:center} and a few others which aren't even real CSS :D, but to no avail.
What am I missing?

basicStyle.css (http://www.voyagercomponents.com/download/bgTest/css/basicStyle.css)
navMenus.css (http://www.voyagercomponents.com/download/bgTest/css/navMenus.css)
transparentBG.css (http://www.voyagercomponents.com/download/bgTest/css/transparentBG.css)

11-26-2008, 07:20 PM
Hello mOrloff,
If you float:left; then margin:0 auto; doesn't center anymore... you could margin it over with margin: 150px 0 0 0; or something, and that would work because the widths aren't going to change inside your container.

Or you could try this display:inline; instead of floating. Like this:

/* subNav menus defaults */
ul.navSub{overflow: auto;}
ul.navSub li{display: inline;}
ul.navSub li a{
display: inline-block; /**I think(?) that keeps your block working**/
text-align: center;
text-decoration: none;
border-left: 1px solid #777;
}/* footer*/
.center .footer{
#navFooter, #contactInfo, #copyright {
text-align: center;
padding: .75em 0 0 0;
font-size: .689em;
letter-spacing: .15em;
padding: .65em 0 .4em 0;
width: 100%;
ul#contactInfo li{
padding: 0 1.75em;
font-size: .5em;
letter-spacing: .1em;
display: inline;
padding: 0 2em;
font-weight: normal;
font-size: .375em;
letter-spacing: .15em

11-27-2008, 06:29 AM
set the ul width and then margin:auto;

11-27-2008, 07:33 AM
Yes, that centers it as long as no-one resizes their browsers font.