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

Re: Proposal: content-vertical-alignment

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Fri, 10 Jun 2005 10:22:54 +0300
Message-ID: <42A93FCE.9010409@peda.net>
To: "www-style@w3.org" <www-style@w3.org>

Emrah BASKAYA wrote:
> On Thu, 09 Jun 2005 18:25:57 +0300, Mikko Rantalainen
> <mikko.rantalainen@peda.net> wrote:
>>
>>I propose a new property
>>margin-box-model: [ horizontally-symmetric | symmetric ]
>>default value: horizontally-symmetric
> 
> Nice idea, I am in for any solution that will let me do the job. Some
> points I'd like to make tho, this may not be as easy to fix in the current
> margin-method, because two or more block level elements with margin: auto
> (symmetric) may come one after another and what should happen in those
> circumstances should also be defined.

I think that if the box model is claimed to be symmetric, then the 
behavior should be the same for both vertical and horizontal 
directions. To me this is logically the same as having multiple 
non-replaced 'inline-block' elements on a row; the spec already 
defines such case as following:

http://www.w3.org/TR/CSS21/visudet.html#q12
"If 'width' is 'auto', the used value is the shrink-to-fit width as 
for floating elements.

A computed value of 'auto' for 'margin-left' or 'margin-right' 
becomes a used value of '0'. "

Again, simply replace 'width' with 'height', 'left' with 'top' etc.

After saying that, I don't believe this is a good way to define 
"margin: auto" for vertical spacing. I think it's a statement that 
current 'inline-block' layout rules for 'auto' values are not good 
enough. The whole point of "symmetric" value is to ask the UA to 
handle both vertical and horizontal sizing identically. All the 
tweaks we're able to do horizontally will be needed also vertically 
once the top-to-bottom content keeps increasing in the web.


> One advantage of having to deal with the content position
> (content-vertical-align) instead of position relative to the parent
> (margin: auto) is that, we would not *need* to have a parent to adjust to.

How do you define content position centered to something that isn't 
the parent? I realize that we need text-vertical-align property if 
we're claiming to be symmetric, but having properties that *really* 
access margin values is far from transparent system.

Current system defines "centering" as applying equal margins to all 
sides of the content. You have to describe new centering features in 
the same terms.

Also, if I have structure

<div><a/><b/></div>

and rule

div, a, b { content-vertical-align: center; display: block; }

and <div> is higher than than combined height of <a> and <b>, how 
they will be positioned? If 'content-vertical-align' adjusts 
"margin"s, how do I define the spacing between <a> and <b>?

> see a reason why two methods should not co-exist. I still believe
> content-vertical-align is easier to understand and to define, tho.

For the simple case, yes. However, as I reasoned earlier, once you 
deal with the interactions with margins the positioning could be far 
from simple. Also, the cascade and inheritance may prove to be hard 
with this model (just a guess...)

-- 
Mikko
Received on Friday, 10 June 2005 07:22:59 GMT

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