我正在创建一个简单的表单,我无法获得与文本框高度相同的提交按钮。当我向提交按钮添加高度时,它将整个表单向下移动。我错过了什么?CSS表单输入提交按钮的高度不正确?
下面是代码:http://jsfiddle.net/7zknq/1/
<style type="text/css"> ::-webkit-input-placeholder { color: #acacac; } input { margin: 0; }</style>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
<form style="padding:0; margin:0;">
<div style="font-family: 'Open Sans', sans-serif; color:#848484; line-height:36px;">
Testing a form, padding is off on submit button!
<input style="display:inline; background-color:#CCC; border:none; height:36px; width:146px; padding-bottom:3px;" type="text" name="name" />
<input style="display:inline; background-color:#CCC; border:none; height:36px; width:146px; padding-bottom:3px;" type="text" name="name" />
<input style="display:inline; background-image:none; background-color:#30aa13; border:none; color:#fff; height:36px; font-size:16px;" value="GO" type="submit" />
</div>
</form>
在此先感谢,鲍勃:)
给'输入{线高度:...}'通过CSS,输入元件是显示:内联块或内联,从而可以改变行为 – 2013-04-30 19:34:52
尝试这个http://jsfiddle.net/uNRkm/ – PSL 2013-04-30 19:45:11