Answer the question
In order to leave comments, you need to log in
Bootstrap 3 center align blocks?
How to center align blocks to resolve col-sm col-xs ?
now aligned .block1 left .block2 center .block3 right
<div class="container">
<div class="row padded">
<div class="col-lg-2 col-md-3 col-sm-12 col-xs-12">
<div class="block1">лого</div>
</div>
<div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
<div class="block2">поиск</div>
</div>
<div class="col-lg-2 col-md-3 col-sm-12 col-xs-12">
<div class="block3">корзина</div>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Blocks or block content? there is a .text-center class for the content. Block by block, they gave you the answer
so far so it turned out
can there be other options?
@media screen and (max-width: 768px) {
.col-center-xs {
text-align: center!important;
}
}
There is also col-offset
Read the official documentation.
getbootstrap.com/css/#grid-offsetting
<div class="row">
<div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
<div class="col-sm-5 col-sm-offset-2 col-md-6 col-md-offset-0">.col-sm-5 .col-sm-offset-2 .col-md-6 .col-md-offset-0</div>
</div>
<div class="row">
<div class="col-sm-6 col-md-5 col-lg-6">.col-sm-6 .col-md-5 .col-lg-6</div>
<div class="col-sm-6 col-md-5 col-md-offset-2 col-lg-6 col-lg-offset-0">.col-sm-6 .col-md-5 .col-md-offset-2 .col-lg-6 .col-lg-offset-0</div>
</div>
Just add display: inline-block + float: none to the block. It worked for me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question