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

Re: Proposal: content-vertical-alignment

From: Emrah BASKAYA <emrahbaskaya@hesido.com>
Date: Thu, 09 Jun 2005 19:28:24 +0300
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.sr32pmcb8nstxa@lomarnona>

On Thu, 09 Jun 2005 18:25:57 +0300, Mikko Rantalainen
<mikko.rantalainen@peda.net> wrote:

> 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.
> Thoughts?

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.

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.
There is text-align:center (which is a bit misinterpreted by some browsers
actually) for that job doing horizontal centering without extra markup
(tho not for block level elements, but they have the margin: auto for
that).. content-vertical-align could be a way to center contents without
having to wrap them in an extra element, thus eliminating the need for
extra markup. And its a little easier to understand, and get it in the
draft probably, as extra rules as when to what the UA should do when two
or more consecutive block-level elements are in the document such as:
||     ||
||     ||

If the two inner elements had margin: auto with the new symmetric keyword
on, what should the UA do? Should they bind? Should they be distributed
along the parent div? These are definable indeed, but will need a bit more
work than simply defining content-vertical-align in the draft.

A content-vertical-align may also be used for gluing contents to the
bottom of the containg div with the 'bottom' keyword which I forgot to
declare in the proposal definition (but pointed out in the detail) Not a
big selling point but still a nice possibility for some designs. Maybe,
the margin suggestion you did can be extended for gluing content to the
bottom of the containing element. Anyway, vertical-centering is much more
important than gluing to bottom.

> +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.)

Yes, and also, this is a UA issue. I wouldn't prefer the sliding for
instance, but it could be done, and how the UA gets there is out of the
specs horizon, but the end result.

Thanks a lot for brain-storming on this issue, maybe doing it with margin
may be easier to handle once some extra portions are defined. I also don't
see a reason why two methods should not co-exist. I still believe
content-vertical-align is easier to understand and to define, tho.

Received on Thursday, 9 June 2005 16:28:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:18 UTC