I have a horizontal unordered list I want to center horizontally in a div container (that's arbitrarily bigger than the list). I was thinking of displaying the ul as a block and using auto margins to center the list within its parent container. But... I can't seem to get the ul to display as a block and not take 100% width.
From what I understand, block elements take the required width to wrap around children elements (unless they're uncleared floats or absolute positionned), so I would think that placing the ul and li's as blocks should do the trick. Unfortunately it doesn't and I don't understand why.
Any idea?
Here's the code: http://jsfiddle.net/kccbg/1/