Usually there is a set of links in the footer presented in the list, for example:
<div id="footer"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> </div>
I want everyone in the footer of the div # to be horizontal. If it were a paragraph, you would simply say: p { text-align: center; } p { text-align: center; } . Or, if I knew the width of <ul> , I could just say #footer ul { width: 400px; margin: 0 auto; } #footer ul { width: 400px; margin: 0 auto; } #footer ul { width: 400px; margin: 0 auto; } .
But how do you center unordered list items without setting a fixed width to <ul> ?
EDIT: clarification - list items should be next to each other, and not below.
html css centering
philfreo Nov 08 '09 at 2:41 2009-11-08 02:41
source share