2014-06-07 11 views
0

我已經創建了一個簡單的登錄表單。以下是登錄表單的屏幕截圖。fieldsets之間的空間如何刪除它

enter image description here

下面是HTML代碼。我已經使用了960框架。

<article class="container_12"> 
     <section id="login" class="grid_3"> 
       <form action="POST"> 
        <div id="loginheader"></div> 
        <fieldset class="logininputfields"> 
         <input type="text" name="username" placeholder="Username" autofocus> 
         <input type="password" name="password" placeholder="Password"> 
        </fieldset> 
        <fieldset class="submitfield"> 
         <input type="submit" value="Log In"> 
        </fieldset> 
       </form> 
     </section> 
    </article> 

這裏是CSS

#login 
{ 
    height: 330px; 
} 

#loginheader 
{ 
    background: black; 
    height: 32px; 
} 

.logininputfields 
{ 
    background-color: #e5e5e5; 
    padding-left: 24px; 
    padding-bottom: 40px; 
    height: 160px; 
} 

.logininputfields input[type="text"],input[type="password"] 
{ 
    background: #c8cbcc; 
    margin-top: 30px; 
    border:1px solid #ccc; 
    color: #ededed; 
    font-weight: 600; 
    height: 30px; 
    width: 170px; 
} 

.submitfield input[type="submit"] 
{ 
    background: #0099ff; 
    border: 1px solid #ccc; 
    height: 42px; 
    width: 220px; 
    font-weight: 600; 
    font-size: large; 
    color: white; 
} 


.submitfield input[type="submit"]:hover 
{ 
    background: rgba(0,154,255,0.60); 
} 

我不明白爲什麼有提交按鈕和灰色區域之間的空間。如何避免它?

+0

使用'字段集{保證金:0像素padding0px;}' –

回答

1

您正在查看的瀏覽器可能具有默認頁邊距全部字段集。試着像這樣的東西去除那些利潤率頁寬:

fieldset { 
    margin:0px; 
    padding:0px; 
} 
+0

好現在的作品...但我怎麼能居中的頁面? – Mazzy

+0

你可以嘗試這樣的事情嗎? http://stackoverflow.com/a/618137/1691091 –

+0

對不起,我忘了它。我通過你的建議修復了它。 – Mazzy