表单文本框尺寸调整与按钮对齐问题(分成了两行)
现贴最终设置成功的代码:
html:
代码如下:
<form action="" method="get">
<input type="text" style="width:300px;height:30px"name="q">
<input type="submit" value="Search" style="height:30px;position:absolute;+margin-top:1px">
</form>
具体作用为:
style="width:300px;height:30px" 设置文本框的尺寸;
style="height:30px;position:absolute;+margin-top:1px" 设置按钮与文本框对齐。注:楼主使用的是IE,Firefox设置可以参考我另一篇转载的文章。
css:
代码如下:
form{
position:relative;
left:450px;
}
作用:将表单整体右移
最后贴下成功的网站页面: