1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > html文本框对齐 display:block html – 在所有浏览器中垂直对齐标签和文本框

html文本框对齐 display:block html – 在所有浏览器中垂直对齐标签和文本框

时间:2019-12-10 03:27:38

相关推荐

html文本框对齐 display:block html – 在所有浏览器中垂直对齐标签和文本框

显示:内联块声明不是IE7及以下的

fully supported,所以你必须使用display:inline而不是zoom:1 hasLayout hack模仿声明与明星hack以IE7为目标.要对齐文本框和标签,我们可以使用vertical-align:middle属性,如下所示:

CSS

input.textBox {

margin-top: 5px;

margin-bottom: 5px;

height: 30px;

width: 350px;

font-size: 15px;

font-family: Verdana;

line-height: 30px;

display:inline-block;

*display: inline; /* for IE7*/

zoom:1; /* for IE7*/

vertical-align:middle;

}

label.inputLabel {

font-family: Verdana;

font-size: 15px;

line-height: 30px;

display:inline-block;

*display: inline; /* for IE7*/

zoom:1; /* for IE7*/

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。