valign not working on a td?

前端 未结 1 1520
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-21 09:23

I have a table that contains a form, in the left col is the name of the field, and i would like to set the text to the top of the td, as at the moment the text is at the bot

1条回答
  •  轮回少年
    2020-12-21 09:54

    Firstly,

    You shouldn't really be using tables for layout (even for forms) you should use divs and CSS: how to make full height cell in full height table in Internet Explorer

    Secondly,

    valign was deprecated, we now use the css property vertical-align see why not to use valign: http://phrogz.net/css/vertical-align/index.html

    HMTL:

    Blah

    CSS:

    .className {
       vertical-align: middle;
    }
    

    0 讨论(0)
提交回复
热议问题