JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wr wr__1">
<div class="block block__1">БЛОК 1</div>
<div class="block block__2">БЛОК 2</div>
<div class="block block__3">БЛОК 3</div>
</div>
<div class="wr wr__2">
<div class="block block__4">БЛОК 4</div>
<div class="block block__5">БЛОК 5</div>
<div class="block block__6">БЛОК 6</div>
</div>
CSS
.wr {
display: flex;
width: 100%;
height: 50px;
}
.block {
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
color: #fff;
text-shadow: 1px 1px 2px #000;
font-weight: bold;
}
.block__1 {
background: #ff0000;
}
.block__2 {
background: #00ff00;
}
.block__3 {
background: #0000ff;
}
.block__4 {
background: #ff00ff;
}
.block__5 {
background: #00ffff;
}
.block__6 {
background: #ffff00;
}
.wr__2 {
margin-top: 50px;
}
JavaScript
$(window).on('resize',function() {
if (window.matchMedia('(max-width: 600px)').matches) {
$('.block__1').appendTo('.wr__2');
}
});
$(document).ready(function() {
$(window).trigger('resize');
});