Reputation: 12672
I feel like I am missing something easy or stupid. This is the only element on my page that I can't seem to center. I cannot seem to centerul#footer
.
Upvotes: 0
Views: 12089
Reputation: 149804
To center the footer contents horizontally, just add the following CSS:
#footer {
text-align: center;
}
Demo: http://jsfiddle.net/mathias/GZ6xh/
If you’re looking to center the entire element, just give it a width and then use margin: 0 auto
:
#footer {
width: 400px;
margin: 0 auto;
}
Upvotes: 2
Reputation: 131
I find two solutions:
both here, one is commented: http://jsfiddle.net/AzNqm/
ul
, and center block with margin:auto
li
elementsEffect will be the same.
Upvotes: 0
Reputation: 199
The width of ul#footer is undefined, so it uses the default width of "100%". I tried using width:261px, and then it does center.
Upvotes: 1