简体   繁体   English

使用Bootstrap选择框的高度/宽度与其他表单输入框的高度不匹配

[英]Select Box height/width with Bootstrap does not match height of other form input boxes

I have a form that I'm making with Bootstrap. 我有一个用Bootstrap制作的表格。 The inputs are just text boxes, but there is one select box . 输入只是文本框,但是有一个select box I've tried using the input-xs and input-mini classes but the height of the select box does not match the height or width of the other input boxes and does not seem to change. 我尝试使用input-xsinput-mini类,但是select box的高度与其他输入框的高度或宽度不匹配,并且似乎没有变化。 Is this an incorrect class issue or is there something else going on? 这是一个不正确的班级问题,还是还有其他事情发生?

I've created a fiddle here: https://jsfiddle.net/c85uaqmt/ . 我在这里创建了一个小提琴: https : //jsfiddle.net/c85uaqmt/

Try to add the class "input-group" 尝试添加类“ input-group”

 <div class="form-group input-group">
    <label for="sel1">Select list:</label>
    <select class="form-control" id="select" placeholder="">
        <option>1</option>
        <option>2</option>
        <option>3</option>
    </select>

You should make the input's form-control too. 您也应该进行输入的form-control Also, the markup is missing a closing DIV tag. 此外,标记缺少关闭的DIV标签。

<input class="form-control" id="Name" name="Name" type="text" placeholder="">

http://bootply.com/vpTL7MHHZG http://bootply.com/vpTL7MHHZG

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM