GJK wrote:
> 
> Good point.  However, CSS 1 still does not appear to make allowance for
> vertical centering, and neither does Mozilla.  I'm still reading through
> CSS 2, but as its' spec is quite different I'm as yet unclear.
> 
> For example, in the following code example...
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
>          "http://www.w3.org/TR/REC-html40/loose.dtd">
> <html>
> <head>
> <title>Centering Using Margins In CSS 1</title>
> </head>
> <body style="width: 100%; height: 100%; background-color: blue; margin:
> 0;">
> <div style="background-color: red; width: 100px; height: 100px; margin:
> auto;">
> </div>
> </body>
> </html>
> 
> ...the block div element is horizontally centered, but not vertically.

In vertical margins, a value of auto on a block becomes 0.
http://www.w3.org/TR/REC-CSS2/visudet.html#q17

Reply via email to