Link to home
Start Free TrialLog in
Avatar of level9wizard
level9wizardFlag for Canada

asked on

Centering a ul without width?

I have a ul that looks like the one in the code snipper (below). I'm trying to have the ul centered horizontally but it seems I can only do this if I apply a width to the ul. The only problem with that is that my li's are dynamic and shrink and grow. The blue border i've applied to #footer ul for testing shows it's 100% of the page... I just need it to auto to the combined width of the li's, and center horizontally.


#footer ul{
	margin: 0 auto; padding: 0;
	list-style: none;
	font-size: 11px;
	color: #fff;
	text-transform: uppercase;
	position: relative;
	border: 1px solid blue;
	
}
#footer li{
	float: left;
	padding-left: 40px;
	line-height: 45px;
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of LZ1
LZ1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of level9wizard

ASKER

LZ1, unfortunately that does not work - I did try it and forgot to mention in my original question. Thanks for trying.