Previous Message
Next Message

Re: [css-d] vertical align and doctype

Sent by Peter-Paul Koch on 29 January 2002 04:04


> >>I'm trying to make this work in IE
> >>
> >>.mid {vertical-align:middle}
> >>
> >><tr class="mid">
> >>
> >>Works fine until I add the doctype for transitional 4.01. What wrong?
>
>PPK> This is without a doubt one of the most annoying things about CSS: 
>it's
>PPK> simply not possible to vertical-align something. As far as I can 
>remember
>PPK> this is a feature, not a bug. But I have no idea why this is so.
>
>PPK> As far as I can remember vertical-align should work only on inline 
>elements
>PPK> (or pure text nodes) inside something (block level in general? Only 
>DIV's?
>PPK> Can't remember). In any case the rules were very complex for no good 
>reason.
>PPK> Could anyone explain, especially the rationale (or lack of it) behind 
>this
>PPK> decision?
>
>The 'vertical-align' property in CSS1 is solely related to the
>positioning of boxes *inside* the inline box, when the different boxes
>are not of the same height. This can happen when one word in a line
>has a bigger font, or when inline non-floated images are used.

Yep, that was it. My next question: why such a hideously complicated 
defintion when vertical aligning is really so simple?

>For CSS2, the semantics for 'vertical-align' were changed, and now it
>can be used as a replacement for the valign attribute on table cells
>(but not on rows).
>   http://www.w3.org/TR/REC-CSS2/tables.html#height-layout

Again, too little. This is only about TD's. I want vertical-align to work on 
*anything* inside a box.

I'm really very concerned about this problem. Why haven't the creators of 
the specs foreseen that we need a simple way of vertical aligning?

ppk

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
Previous Message
Next Message

Message thread:

Possibly related: