On 2007-10-30, Summercool <Summercoolness (AT) gmail (DOT) com> wrote:
Quote:
since the way we center a div in a page is usually fix a width: 600px
and then set margin left and right both "auto"... |
Correct.
Quote:
so what if we don't know the width in advance, or want it to be
automatic? in that case, use display: table? (as someone suggested
using that will make a div "shrink to fit". is it a standard way?
coz setting a non-table div to table display is kind of weird. |
What's weird about it?
Display: inline-block with text-align: center on the container. But only
works in Opera and Konqueror/Safari out of well-known browsers.