【发布时间】:2012-01-24 12:22:15
【问题描述】:
有人可以就如何在同一行对齐表单输入提供一个简单的解决方案, 例如,很多时候,当我构建一个表单时,我可以让它们相互对齐并且看起来不错,但是如果我将两个输入(如 textarea/text)放在另一个文本或按钮旁边,我会得到垂直对齐差异。有没有办法在不摆弄边距和填充的情况下解决这个问题?
例如:
<style type='text/css'>
form{
display:inline;
}
textarea{
font-size:25px;
height:25px;
width:200px;
}
input.button{
height:25px;
width:50px;
}
</style>
<form>
<textarea >Value</textarea><input type='button' class='button' value='Go'>
</form>
【问题讨论】:
-
确保你没有 clear:left 某处