----------------------
A | B | C
----------------------
when scaled to mobile I will expect:
-------
B
-------
A
-------
C
Is it possible with new in Bootstrap3 push
option?
I was trying
<div class="row">
<div class="col-xs-12 col-sm-3 col-sm-push-6" style="background-color:red">
A
</div>
<div class="col-xs-12 col-sm-6 cols-sm-pull-3 no-col-padding">
<center>
B
</center>
</div>
<div class="col-xs-12 col-sm-3" style="background-color:pink">
C
</div>
</div>
We can easily change the order of built-in grid columns with push and pull column classes. The Push and Pull Classes: The push class will move columns to the right while the pull class will move columns to the left.
By default, this will display the main content first. So in mobile, the main content will be displayed first. Try using col-lg-push and col-lg-pull to reorder the columns in large screens and display the sidebar on the left and main content on the right.
Bootstrap 4.1+ Since Bootstrap 4 is flexbox, it's easy to change the order of columns. The cols can be ordered from order-1 to order-12 , responsively such as order-md-12 order-2 (last on md , 2nd on xs ) relative to the parent . row . It's also possible to change column order using the flexbox direction utils...
To move columns to the right, use the . col-*-offset-* class in Bootstrap.
See this question
col-vp-push-x
= push the column to the right by x number of columns, starting from where the column would normally render -> position: relative
, on a vp or larger view-port.
col-vp-pull-x
= pull the column to the left by x number of columns, starting from where the column would normally render -> position: relative
, on a vp or larger view-port.
vp = xs, sm, md, or lg
x = 1 thru 12
I think what messes most people up, is that you need to change the order of the columns in your HTML markup (in the example below, B comes before A), and that it only does the pushing or pulling on view-ports that are greater than or equal to what was specified. i.e. col-sm-push-5
will only push 5 columns on sm
view-ports or greater.
DEMO
<div class="row">
<div class="col-sm-5 col-sm-push-5">
Content B
</div>
<div class="col-sm-5 col-sm-pull-5">
Content A
</div>
<div class="col-sm-2">
Content C
</div>
</div>
View-port >= sm
|A|B|C|
View-port < sm
|B|
|A|
|C|
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With