Sun, 27 Jan 2008 13:30:37 -0600, /Ben C/:
> I have a question. If you do this:
>
[quoted text clipped - 6 lines]
> does IE put the yellow box containing the word "Hello" at the bottom of
> the green box or pretty much in the middle?
No, it doesn't put "Hello" at the bottom of the green box but pretty
much in the middle. However if I put one more <span> with a bigger
text, both <span> bottoms get aligned (the bigger <span> gets in the
middle of the green box):
<div style="line-height: 200px; background-color: green">
<span style="vertical-align: bottom; background-color: yellow">
Hello
</span>
<span style="vertical-align: bottom; background-color: orange;
font-size: 3em;">
Hello
</span>
</div>

Signature
Stanimir
Stanimir Stamenkov - 27 Jan 2008 23:17 GMT
Mon, 28 Jan 2008 00:46:47 +0200, /Stanimir Stamenkov/:
> Sun, 27 Jan 2008 13:30:37 -0600, /Ben C/:
>
[quoted text clipped - 23 lines]
> </span>
> </div>
O.k. I'm obviously missing the 'line-height' gets inherited, so the
following may be a better sample to look at:
<div style="line-height: 200px; background-color: green;">
<span style="vertical-align: bottom; background-color: yellow;
line-height: 50px;">
Hello
</span>
<span style="vertical-align: bottom; background-color: orange;
font-size: 3em; line-height: 50px;">
Hello
</span>
</div>

Signature
Stanimir
Ben C - 27 Jan 2008 23:31 GMT
> Mon, 28 Jan 2008 00:46:47 +0200, /Stanimir Stamenkov/:
>> Sun, 27 Jan 2008 13:30:37 -0600, /Ben C/:
[...]
>> No, it doesn't put "Hello" at the bottom of the green box but pretty
>> much in the middle. However if I put one more <span> with a bigger
[quoted text clipped - 13 lines]
> O.k. I'm obviously missing the 'line-height' gets inherited, so the
> following may be a better sample to look at:
Yup, I just figured out the same thing :)
><div style="line-height: 200px; background-color: green;">
> <span style="vertical-align: bottom; background-color: yellow;
[quoted text clipped - 6 lines]
> </span>
></div>
What I see there is a small gap underneath the yellow inline box which
corresponds to the half-leading added to that inline box to make it up
to its line-height of 50px. The bottom edge of that 50px high thing is
what's aligned to the bottom of the 200px line box.
Ben C - 27 Jan 2008 23:28 GMT
> Sun, 27 Jan 2008 13:30:37 -0600, /Ben C/:
>
[quoted text clipped - 13 lines]
> text, both <span> bottoms get aligned (the bigger <span> gets in the
> middle of the green box):
Right. But not in Firefox, Opera or Konqueror. They all put both spans
vertically centered in the line box.
I just realized why. It's because line-height is inherited. What's
happening is that top and bottom half-leading is added to the _inline
boxes individually_ before they are aligned within the line box.
I don't think it's anything to do with those implementations using
"provisional" line-box heights to do vertical-align: top and bottom
after all.
Including the inline-box leading, the things being aligned are all 200px
since they inherited that line-height. So they aren't free to move up or
down at all in the line box which is also 200px high.
Anyway, if you add a rule:
span { line-height: normal }
then the inline boxes align to the top, bottom or middle of the green
area in much more the expected fashion. Although I don't think the spec
guarantees that they will be-- neither exactly how the inline box is
fitted to the text nor what line-height: normal means are precisely
specified.
><div style="line-height: 200px; background-color: green">
> <span style="vertical-align: bottom; background-color: yellow">
[quoted text clipped - 5 lines]
> </span>
></div>