Eh, auto fields should have a set width, since the default is a block level element such as
will expand to the full available width.
If you do not support IE <8, you can simply set {display: table; margin: 0 auto; }
Otherwise, if your element is surrounded by block level elements, you can do p {display: inline-block; } p {display: inline; } html> / ** / body p {display: inline-block; } (the last two rules for IE and resetting the IE fix for smart browsers), then apply {text-align: center; } in the container.
As already mentioned, see http://haslayout.net/css-tuts/Horizontal-Centering for more information.
Hooray! Zoffix znet
Zoffix znet
source share