I want to change the column order only in xs devices with bootstrap this is what i got
<div class="container">
<div class="row">
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">column left</div>
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
<div>Column right nro 1</div>
<div>Column right nro 2</div>
</div>
</div>
I want to focus on the right column, only in xs devices i need them to be inverted showing first column right nro 2 and then column right nro 1.
One way to do it is using display: table and caption-side property and wrap those properties into xs-media rules:
@media (max-width: 768px) {
.col-right {
display: table;
}
.col-right > div:nth-child(2) {
display: table-caption;
margin: 0 15px;
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments