JSFiddle - React, Tailwind, and code Playground
HTML
Resize this window until the divs switch places.
<div class="wrapper">
<div id="first_div" class="col">first div</div>
<div id="second_div" class="col">second div</div>
</div>
CSS
.wrapper {
display: flex;
flex-direction: row;
}
.col {
width: 100px;
float: left;
border: 1px solid black;
padding: 5px;
/*flex-grow: 1;*/
}
#first_div {
background: yellow;
height: 200px;
}
#second_div {
background: cyan;
height: 100px;
}
@media (max-width: 400px) {
.wrapper {
flex-direction: row-reverse;
justify-content: flex-end;
}
}