2014-01-15 62 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/