valign不工作在td? [英] valign not working on a td?

查看:97
本文介绍了valign不工作在td?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格,其中包含一个表单,在左边的col是该字段的名称,我想设置文本到td的顶部,因为在文本是在底部。 / p>

有没有人知道为什么这是一个hit和miss元素属性?

解决方案

首先,



你不应该真正使用表格布局(即使是表单),你应该使用 div s和CSS:
如何在Internet Explorer中在完整高度表中创建完整高度单元格



其次,



valign 已弃用,我们现在使用css属性 vertical-align 使用 valign
http:// phrogz。 net / css / vertical-align / index.html



HMTL:



< div class =className> Blah< / div>



CSS:

  .className {
vertical-align:middle;
}


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;
}

这篇关于valign不工作在td?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆