Re: [CSS21] Vertical align

On 7 Oct 2003 at 12:52, L. David Baron wrote:

> 
> On Tuesday 2003-10-07 21:30 +0200, staffan.mahlen@comhem.se wrote:
> >     <img style="vertical-align: top" src="test.png" />Text <img 
> > style="vertical-align: bottom" src="test.png" />
> > What should be the result and why?
> 
> The correct layout is undefined since (using the terminology in [1]) the
> tallest loose subtree in the line is not the one established by the root
> inline box.  
I should have thought this through better. Thanks for explaining. I 
agree that there should be at least a note or something that gives 
the hint that there are combinations of 'vertical-align' that are 
undefined.

> 
> > If we switch the last to middle, how does that work 
> Again using terminology from [1], the tallest loose subtree is now the
> one established by the root inline box, so the layout is defined.
> > "top
> > Align the top of the box with the top of the line box.
> > bottom
> > Align the bottom of the box with the bottom of the line box."
> > 
> > Why are they not relative to the parent like the other align 
> > properties?
> Because then they'd be equivalent to 'text-top' and 'text-bottom'?  
Hmm, only if the restriction on non-replaced inline element height to 
be calculated based only on the text they have or could have i 
belive. To my mind that and the way margin/border/paddings are 
handled seem like a problem.

> [1] http://dbaron.org/css/2000/01/dibm
I actually read this one a few times a while ago and thought i 
understood it at the time. It is very helpful. This time around i 
wonder if i am still only half-getting it...
> [2] http://lists.w3.org/Archives/Public/www-style/1999Mar/0121.html

Again, thanks for the very informative answer.
 /Staffan

Received on Thursday, 9 October 2003 13:17:15 UTC