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

by JM note

HTML

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