网络表单中的间距

时间:2013-09-06 16:21:50

标签: html css forms jsfiddle

我在使用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;
}

2 个答案:

答案 0 :(得分:2)

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

height: 69px;
vertical-align:top;

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

答案 1 :(得分: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;
}