CSS Grid - Templete Rows and Columns

ChungsikPark·2019년 12월 17일
0

CSS

목록 보기
2/15

grid-basic.jpeg

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>CSS Grid</title>
    <style>
      .father {
        display: grid;
        grid-template-rows: 30px 12px; /* 행, height */
        grid-template-columns: 30px 50px; /* 열, width */
        grid-gap: 5px; /* 간격 */
      }
      .box {
        background-color: #f1c40f;
      }
    </style>
  </head>
  <body>
    <div class="father">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>
    </div>
  </body>
</html>
profile
Blog by Chungsik Park

0개의 댓글