I have used order-sm-first how I can use this for old xs Extra small <576px ?
order-first work in all query
<div class="col-md-6 col-sm-12 order-sm-first">
Column ordering classes in Bootstrap helps to change the order of our grid system based on different screen sizes eg: desktop, mobile, tablet, smartwatches. This makes the website more responsive for different screen sizes. We can easily change the order of built-in grid columns with push and pull column classes.
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...
If you use col class the columns will be of equal width. If you use col-auto the width of the column will be the width of the contents in the column. You can even use a combination of both, like below. In this case the first column width will be equal to the contents of that column.
1 — Vertical Center Using Auto Margins One way to vertically center is to use my-auto . This will center the element within it's flexbox container (The Bootstrap 4 . row is display:flex ). For example, h-100 makes the row full height, and my-auto will vertically center the col-sm-12 column.
You're looking for order-first
. Only use of the actual -xs
infix was dropped. The xs breakpoint (<576px) still exist but now it's the default or implied breakpoint so you don't need to specifically use -xs
.
Also know that order-first
really means 1st on "xs and up" so it needs to be overridden by a larger breakpoint as needed...
<div class="container">
<div class="row">
<div class="col-6">
1 (first on sm and up)
</div>
<div class="col-md-6 col-sm-12 order-first order-sm-last">
2 (first on xs)
</div>
</div><!--/row-->
</div><!--container-->
https://codeply.com/go/WMnCWPikCh
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