JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container" class="one-column">
<div class="col1" style="order:2;">
ONE
</div>
<div class="col2" style="order:1;">
TWO
</div>
<div class="col1" style="order:4;">
THREE
</div>
<div class="col2" style="order:3;">
FOUR
</div>
</div>
CSS
* {
box-sizing: border-box;
}
div {
width: 100%;
height: 100px;
}
#container.one-column {
display: flex;
flex-direction: column;
height: auto;
}
.col1 {
width: 60%;
background-color: red;
height:300px;
}
.col2 {
width: 40%;
background-color: blue;
border: 1px solid white;
}
.one-column > div {
width: 100%;
}
@media (min-width: 500px) {
#container.one-column {
display: block;
columns: 2;
}
#container.one-column > div {
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid;
}
.zcol1 ~ .col1 {
background-color: yellow;
height:100px;
}
}