Html 按钮表单与CSS3和跨浏览器对齐

Html 按钮表单与CSS3和跨浏览器对齐,html,cross-browser,css,alignment,padding,Html,Cross Browser,Css,Alignment,Padding,我一直在尝试让文本字段和按钮彼此对齐,我尝试了两种方法,使用高度,以及填充,但当一个适用于一个浏览器时,另一个不适用,反之亦然 有人知道如何解决这个问题吗?下面是一个屏幕截图 屏幕截图来自于使用下面的代码——当我使用填充而不是高度时,firefox看起来不错,但chrome没有对齐 .buttons { font-family:arial; font-size:18px; height:38px; margin-left:-1px; border:1px solid #b4b4b4; back

我一直在尝试让文本字段和按钮彼此对齐,我尝试了两种方法,使用高度,以及填充,但当一个适用于一个浏览器时,另一个不适用,反之亦然

有人知道如何解决这个问题吗?下面是一个屏幕截图

屏幕截图来自于使用下面的代码——当我使用填充而不是高度时,firefox看起来不错,但chrome没有对齐

.buttons {
font-family:arial;
font-size:18px;
height:38px;
margin-left:-1px;
border:1px solid #b4b4b4;
background: -webkit-gradient(linear, left top, left bottom, from(#cb43b3), to(#a5108b));
background: -moz-linear-gradient(top,  #cb43b3,  #a5108b);
-moz-border-top-right-radius:5px;
border-top-right-radius:5px;
-moz-border-bottom-right-radius:5px;
border-bottom-right-radius:5px;
color:#fff;
}
.buttons:hover {
background: -webkit-gradient(linear, left top, left bottom, from(#a5108b), to(#cb43b3));
background: -moz-linear-gradient(top,  #a5108b,  #cb43b3);
}
.textarea {
border:1px solid #b4b4b4;
-moz-border-top-left-radius:5px;
border-top-left-radius:5px;
-moz-border-bottom-left-radius:5px;
border-bottom-left-radius:5px;
-moz-box-shadow: inset 2px 2px 2px 2px #cfcfcf;
-webkit-box-shadow: inset 2px 2px 2px 2px #cfcfcf;
box-shadow: inset 2px 2px 2px 2px #cfcfcf;
box-shadow: inset 2px 2px 2px 2px #cfcfcf;
padding:7px;
font-family:arial;
font-size:18px;
color:#7e7e7e;
width:300px;
}
假设除了body标签没有其他代码。即使尝试使用body标签,这个问题仍然存在。

稍微修改了一下

.buttons { font-family:arial; font-size:18px; height:40px; border:1px solid #b4b4b4; background:
-webkit-gradient(linear, left top, left bottom, from(#cb43b3), to(#a5108b)); background:
-moz-linear-gradient(top,  #cb43b3,  #a5108b);
-moz-border-top-right-radius:5px; border-top-right-radius:5px;
-moz-border-bottom-right-radius:5px; border-bottom-right-radius:5px; color:#fff; float: left; display: block; } .buttons:hover { background:
-webkit-gradient(linear, left top, left bottom, from(#a5108b), to(#cb43b3)); background:
-moz-linear-gradient(top,  #a5108b,  #cb43b3); } .textarea { border:1px solid #b4b4b4;
-moz-border-top-left-radius:5px; border-top-left-radius:5px;
-moz-border-bottom-left-radius:5px; border-bottom-left-radius:5px;
-moz-box-shadow: inset 2px 2px 2px 2px #cfcfcf;
-webkit-box-shadow: inset 2px 2px 2px 2px #cfcfcf; box-shadow: inset 2px 2px 2px 2px #cfcfcf; box-shadow: inset 2px 2px 2px 2px #cfcfcf; padding: 0px 7px; font-family:arial; font-size:18px; color:#7e7e7e; width:300px; height: 38px; line-height: 38px; float: left; display: block; margin-right: 2px; }