Arnost Sobota <sabotage (AT) minefi (DOT) gouv.fr> wrote:
Quote:
Is there a way to minimize the width of a div (so that it fits exactly
its content) and make the horizontal centering work? |
2 ways:
1) Setting the display property to inline-block or inline-table (browser
support varies, search the archives), and then specify text-align:center
on the containing block.
2) Setting the display property to table invokes the familiar shrink to
fit table model, caveat: IE doesn't support the CSS table model.
--
Spartanicus