能够使用Bootstrap 3网格系统来指定选择元素的宽度 [英] Ability to use Bootstrap 3 grid system to specify width of select element
问题描述
我有以下< select>
元素,如下所示:
I have the following <select>
element as follows:
<select id="statusSelect" style="width:175px" class="form-control" name="statusCode">
然而,有人告诉我这会导致隐藏元素的动态异常。我的问题是:我如何使用Bootstrap 3的Grid系统来指定< select>
元素的宽度。我试过以下内容:
However, someone has just told me that this can cause dynamic exceptions on hidden elements. My question is this: How can I use Bootstrap 3's Grid system to specify the width of the <select>
element. I have tried the following:
<select id="statusSelect" class="form-control col-md-2" name="statusCode">
但不幸的是,使用 col-md-2
甚至 col-md-4
不会改变< select>
元素的宽度。那么,任何人都可以帮助我看看如何使用Bootstrap 3的网格类来指定< select>
下拉框的宽度。
But, unfortunately, using col-md-2
or even col-md-4
does not change the width of the <select>
element. So, can anyone help me to see how I can use Bootstrap 3's grid classes to specify the width of the <select>
drop-down box.
任何帮助都将倍受赞赏。
Any help would be much appreciated.
推荐答案
您必须将类添加到包装div。
You have to add the classes to an wrapping div.
<div class="col-md-2">
<select id="statusSelect" class="form-control" name="statusCode">
</div>
这篇关于能够使用Bootstrap 3网格系统来指定选择元素的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!