I need to have a layout that looks like this on a mobile device
----- | 1 | ----- | 2 | ----- | 3 | -----
And how is it on the desktop:
--------- | | 1 | | 2 |---| | | 3 | | |---- | | -----
I decided to use flexbox, my code so far:
<div class="row"> <div class="col-xl secound">2</div> <div class="col-sm first">1<br>2<br>3<br>4</div> <div class="col-xl third">3</div> </div> .row { display: flex; flex-flow: row wrap; } .col-sm, .col-xl { width: 100%; } .col-sm { background: yellow; } .col-xl { &.secound { background: #ccc; } &.third { background: #aaa; } } @media (min-width: 700px) { .col-sm { width: 25%; background: yellow; order: 1; } .col-xl { width: 75%; &.secound { background: #ccc; order: 2; } &.third { background: #aaa; order: 3; } } }
Unfortunately, I cannot move column "3" to "1". What should I do?
Codepen: http://codepen.io/tomekbuszewski/pen/PbprJP?editors=1100
source share