I have tried to change the column order in desktop view and mobile view. In mobile view, Last Name
should be in 2nd place where in desktop, it should be in last.
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="container active col-md-3 col-sm-6 ">
<div class="panel panel-default">
<div class="panel-heading">First Name</div>
</div>
</div>
<div class="container active col-md-3 col-sm-6 col-md-push-6">
<div class="panel panel-default">
<div class="panel-heading">Last Name</div>
</div>
</div>
<div class="container active col-md-3 col-sm-6 col-md-pull-3">
<div class="panel panel-default">
<div class="panel-heading">Address</div>
</div>
</div>
<div class="container active col-md-3 col-sm-6 col-md-pull-3 ">
<div class="panel panel-default">
<div class="panel-heading">Company</div>
</div>
</div>
</div>
2
Answers
There will be a way to get it done using Bootstrap Grid, i.e using
col-md-push-4
and etc.But it’s very much convenient using flex and adding
order
to inner elements.Very useful Flexbox documentation.
I see that you are using push & pull which will only work for the desktop/tablet viewports.
Best is to develop for the mobile as per your need and then use push & pull for the desktop/tablet to make the re-arrangement.
I have achieved similar ordering using the same approach. It works very well.
Update:
Adding the plunker for the same : http://plnkr.co/edit/b2PNXyyXOsXUx51LweJI?p=preview
HTML
CSS