Answer the question
In order to leave comments, you need to log in
Bootstrap grid really 5 columns?
Actually the question is, there are 12 columns, but I would have 5 aligned in the center of the same width. What to do in this case if I have bootstrap?
Answer the question
In order to leave comments, you need to log in
Add extra classes to the top of your css or to the bottom of bootstrap.css:
.col-xs-five,
.col-sm-five,
.col-md-five,
.col-lg-five {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
.col-xs-five {
width: 20%;
float: left;
}
@media (min-width: 768px) {
.col-sm-five {
width: 20%;
float: left;
}
}
@media (min-width: 992px) {
.col-md-five {
width: 20%;
float: left;
}
}
@media (min-width: 1200px) {
.col-lg-five {
width: 20%;
float: left;
}
}
<div class="row">
<div class="btn-group btn-group-justified">
<div class="btn-group">
<div class="col-sm-12">Column 1</div>
</div>
<div class="btn-group">
<div class="col-sm-12">Column 2</div>
</div>
<div class="btn-group">
<div class="col-sm-12">Column 3</div>
</div>
<div class="btn-group">
<div class="col-sm-12">Column 4</div>
</div>
<div class="btn-group">
<div class="col-sm-12">Column 5</div>
</div>
</div>
</div>
Everything is simpler in bootstrap 4)
Creating 5 adaptive blocks with the same width in a row.
<div class="row">
<div class="col"> 1/5 </div>
<div class="col"> 2/5 </div>
<div class="col"> 3/5 </div>
<div class="col"> 4/5 </div>
<div class="col"> 5/5 </div>
</div>
I did this (of all the blocks, only two had 5 columns, the rest were standard 2-3):
html:
<div class="row column-5">
<div class="col-md-1"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-1"></div>
</div>
css:
.column-5 .col-md-1 {
width: 0%;
}
.column-5 .col-md-2 {
width: 20%;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question