2014-01-15 60 views
1

這是一些簡單的問題,但我無法解決它。我無法點擊文本框並使其工作。
請參考這裏我的小提琴:http://jsfiddle.net/5JeaQ/HTML文本框不工作

HTML:

<div id="container"> 
    <div id="form"> 
     <form id="lookup" method="post"> 
      <fieldset> 
       <legend>Phone Directory</legend> 
       <input type="text" id="name" placeholder="Enter name.." autocomplete="off"/> 
       <span id="buttons"> 
        <input type="submit" id="submit" value="Submit"/> 
        <input type="button" id="list_all" value="List All"/> 
       </span> 
      </fieldset> 
     </form> 
    </div> 
    <div id="results"></div> 
</div> 

CSS:

#container{ 
    width: 30%;    
    margin: 0 auto; 
    /*text-align: center;*/ 
}   
#name{ 
    display: block; 
    /*margin: 0 auto;*/ 
} 
#buttons{ 
    padding-top: 25px; 
} 
fieldset{ 
    border-radius: 10px; 
} 
td{ 
    text-align: center; 
} 

回答

2

您的按鈕具有填充頂部。這是爲什麼?它似乎沒有做任何事情,並刪除它可以解決您的問題。

fiddle

CSS:

#container{ 
    width: 30%;    
    margin: 0 auto; 
    /*text-align: center;*/ 
}   
#name{ 
    display: block; 
    /*margin: 0 auto;*/ 
} 

fieldset{ 
    border-radius: 10px; 
} 
td{ 
    text-align: center; 
} 
/*legend{ 
text-align: center; 
}*/ 
+0

這填充是企圖在文本框和按鈕之間有一些空間,以便它不看conjested。謝謝您的回答。 –

+1

嘗試給輸入一個「margin-bottom」 – donnywals

0

試試這個

#buttons{ 
padding-top: 0px; 

}

演示

http://jsfiddle.net/5JeaQ/8/