0

我在尝试使用 HTML/CSS 分隔和排列表单时遇到了一点问题。

我已经在下面发布了 jsfiddle。

我正在尝试将提交按钮与电子邮件提交表单的边框对齐。

谢谢!

http://bit.ly/1embiFX

HTML

<form target="_blank" class="validate" name="mc-embedded-subscribe-form" id="mc-embedded-subscribe-form" method="post" action="#">
<input type="email" value="yourname@beerisawesome.com" onblur="if (this.value == '') {this.value = 'yourname@beerisawesome.com';}" onfocus="if (this.value == 'yourname@beerisawesome.com') {this.value = '';}" id="mce-EMAIL" class="required email" name="EMAIL">
<input type="submit" onclick="_gaq.push(['_trackEvent', 'Sign Up', 'Click', 'Mailing List Address Entered']);" id="mc-embedded-subscribe" name="subscribe" value="JOIN" class="submit button">
</form>

CSS

form {
    margin: 0;
    font-family: 'Merriweather', serif;
    height: 75px;

}
input.email {
    width: 60%;
    height: 75px;
    font-family: 'Merriweather', serif;
    padding-left: 30px;
    font-size: 18px;
    color: #c89808;
    border: 2px solid #000000;
    -webkit-border-top-left-radius: 10px;
    -webkit-border-bottom-left-radius: 10px;
    -moz-border-radius-topleft: 10px;
    -moz-border-radius-bottomleft: 10px;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    background-color: transparent;

}

input.email:focus {
    outline: none;
}

input.submit {
    width: 20%;
    margin-left: -5px;
    margin-top: 50px;
    font-family: league;
    font-size: 30px;
    color: #efbe2a;
    height: 75px;
    background: #000000;
    -webkit-border-top-right-radius: 10px;
    -webkit-border-bottom-right-radius: 10px;
    -moz-border-radius-topright: 10px;
    -moz-border-radius-bottomright: 10px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border: none;
    letter-spacing: 0.05em;
}
4

2 回答 2

2

只需更改高度并为 input.email 类添加垂直对齐

height: 69px;
vertical-align:top;

工作演示:http: //jsfiddle.net/edisutrisno/8V8dg/3/

于 2013-09-06T16:32:19.097 回答
0

尝试这个-

input.submit {
width: 20%;
margin-left: -5px;
margin-top: 50px;
font-family: league;
font-size: 30px;
color: #efbe2a;
height: 81px;
background: #000000;
-webkit-border-top-right-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
-moz-border-radius-topright: 10px;
-moz-border-radius-bottomright: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border: none;
letter-spacing: 0.05em;
position:relative; 
top:4px;
}
于 2013-09-06T16:33:18.073 回答