开发者

valign not working on a td?

开发者 https://www.devze.com 2023-02-15 17:07 出处:网络
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 bottom.

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 bottom.

Does any one know why this is a hit and miss element attribute?


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:

<div class="className">Blah</div>

CSS:

.className {
   vertical-align: middle;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消