On Apr 15, 2004, at 09:06, Gabriel Wicke wrote:
div again, we don't really know what will be inside the center tags. Could be another div for example, or a table.
In my experience, <div style="text-align:center"> and <center> don't do the same thing. Mozilla's standard stylesheet uses a custom -moz-center setting to achieve the <center> rendering.
Demonstration: http://leuksman.com/misc/div-center.html
The <div> inside the <center> block is centered in its parent's content area, but the <div> inside the <div style="text-align:center"> block actually shows up left aligned (though the text inside it is centered). Mozilla's default stylesheet uses a custom "text-align: -moz-center" to achieve <center> rendering, which makes me think there's just no good way to emulate it completely with CSS2.
Anyway, while <center> is forbidden in XHTML 1.0 Strict, it's *not* forbidden by XHTML 1.0 Transitional. Might be better to leave the <center>s as they are for now.
-- brion vibber (brion @ pobox.com)
[center]
which makes me think there's just no good way to emulate it completely with CSS2.
It is possible:
tag { margin-left: auto; margin-right: auto; }
But older/css-uncapable browsers (IE) have problems with it and need special treatment.
Regards Götz
On Thu, 15 Apr 2004 22:22:42 +0200, Götz Hoffart wrote:
Thanks for the tip, this seems to work fine across the browsers i tested (IE6.0,5.5,Moz): /* emulate center */ .center { width: 100%; text-align: center; } div.center * { margin-left: auto; margin-right: auto; }
You can test it at http://test.wikipedia.org/wiki/TestWikipedia:Sandbox.
wikitech-l@lists.wikimedia.org