【发布时间】:2016-11-19 02:29:29
【问题描述】:
我有一个使用 bootstrap CSS 的搜索框表单,其中包含基于类别选择的几列。 首先,我想在同一行中添加所有列并相应地为它们设置自动宽度
.col-lg-12 {
width: 100%;
}
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
float: left;
}
.col-md-6 {
width: 50%;
}
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
float: left;
}
.form-group {
margin-bottom: 15px;
}
.tab-content {
position: relative;
}
<div class="tab-content">
<form style="margin-top:-20px" method="GET" action="">
<div class="col-xs-12 col-md-12 col-lg-12 col-sm-12 go-right">
<div class="form-group">
<img src="http://elizavetababanova.com/wp-content/uploads/2015/06/blue-number-1-md.png" style="width:30px">
</div>
</div>
<div class="col-xs-12 col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<img src="http://www.orangecoastcollege.edu/student_services/counseling/SiteAssets/Pages/DegreeWorks-Plan---Priority-Registration/number-2-orange-md.png" style="width:30px">
</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 go-right">
<div class="form-group">
<img src="http://www.clipartbest.com/cliparts/9cz/E6X/9czE6XLRi.png" style="width:30px">
</div>
</div>
<div class="clearfix"></div>
</form>
</div>
这是我的代码的简短示例,但我的搜索框中有很多列,如何设置 CSS 以使所有列都在 同一行 以及 自动宽度
我想在同一行显示所有列并自动调整大小 基于宽度,即使我们会有更多的列,它也会被调整为自动宽度。甚至为每列和所有列自动设置宽度。像下面的图片
例如,如果我们将有 6 个部分,则自动调整大小并设置为 100% 宽度
如果我们只有三个部分,那么它将被设置为宽度 100%
【问题讨论】:
标签: javascript jquery css bootstrap-modal