W3C home > Mailing lists > Public > www-style@w3.org > June 2005

Re: Proposal: content-vertical-alignment

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Thu, 09 Jun 2005 18:25:57 +0300
Message-ID: <42A85F85.4000303@peda.net>
To: "www-style@w3.org" <www-style@w3.org>

Emrah BASKAYA wrote:
> Proposal: A new property that will allow any content in a given element to
> be centered vertically:
> content-vertical-align

I'd rather just "fix" the vertical margin computation to work 
exectly like the horizontal margin computation. (That is, I could 
just say
   div.special { margin: auto; margin-box-model: symmetric; }
to center div.special both horizontally and vertically.

I propose a new property
margin-box-model: [ horizontally-symmetric | symmetric ]
default value: horizontally-symmetric

Behaviors:

horizontally-symmetric: same as now

symmetric: box model for horizontal margins (left and right) is kept 
as now, vertical margins are changed so that computation is similar 
to horizontal case.

Taking current specification:
http://www.w3.org/TR/CSS21/visudet.html#blockwidth

10.3.3 [...]

Simply replace

"If both 'margin-left' and 'margin-right' are 'auto', their used 
values are equal. This horizontally centers the element with respect 
to the edges of the containing block."

with

"If both 'margin-top' and 'margin-bottom' are 'auto', their used 
values are equal. This vertically centers the element with respect 
to the edges of the containing block."

Apply similar changes to other parts of the spec.

Thoughts?

> 1-) What the browser will do to achieve the 'impossible':
> [...]
>      c) Contents are laid out normally after padding-top, and readjusted
> once the element is closed
>            Pros: Users don't have to wait to see content
>            Cons: There is a single centering pop when closing tag is
> reached. Which is no more of a pop when an image whose dimesions are not
> given is loaded and the layout changes vastly, and much more violently
> then the centering pop, as contents move in all directions.
> [...]
> 3-) There are so many situations where the layout 'moves' like the loading
> of images with unknown dimensions is one prominent example, last time I
> checked, declaring the image size was not required. The last centering
> motion in method C is much easier on the eye, as the contents move only
> vertically, where as the image size push the text around in all directions.

+1 Saying that progressive rendering cannot be done isn't a big 
enough reason not to support this. An UA could even "slide" 
(animate) the content where it's supposed to be if a single "pop" is 
considered too rough. (Compare to "smooth scroll" feature provided 
by most modern UAs that also has supporters and haters.)
Received on Thursday, 9 June 2005 15:26:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:37 GMT