HTML div 3단 분할 모바일 1단 반응형 flex

by JM note

HTML

<style>
.container { display: flex; }
@media (max-width: 600px) {
  .container { display: block; }
}
.box1 {
  background: red;
  flex: 1;
}
.box2 {
  background: orange;
  flex: 3;
}
.box3 {
  background: yellow;
  flex: 1;
}
</style>
<div class='container'>
  <div class='box1'>왼쪽</div>
  <div class='box2'>가운데</div>
  <div class='box3'>오른쪽</div>
</div>