<div class="parent">
<div class="firstChild">firsChild</div>
<div class="secondChild">secondChild</div>
<div class="thirdChild">thirdChild</div>
<div class="fourthChild">fourthChild</div>
</div>
.parent {
display: grid;
grid-auto-rows: 100px;
grid-auto-columns: 100px;
grid-template-areas: "firstChild firstChild firstChild"
"secondChild secondChild fourthChild"
"thirdChild thirdChild fourthChild";
/* 위 모양 대로 생성된다. */
border: solid 10px gray;
}
.firstChild {
grid-area: firstChild;
background-color: plum;
}
.secondChild {
grid-area: secondChild;
background-color: powderblue
}
.thirdChild {
grid-area: thirdChild;
background-color: seashell;
}
.fourthChild {
grid-area: fourthChild;
background-color: wheat;
}
'CSS > Grid' 카테고리의 다른 글
CSS 그리드 라인 네이밍 이용하는 방법과 grid-auto-flow: dense (0) | 2020.03.09 |
---|---|
CSS 그리드 합치기 - grid-column, grid-row, span, grid-area (0) | 2020.03.09 |
CSS 전체 그리드 정렬 - justify-content, align-content, justify-items, align-items (0) | 2020.03.09 |
CSS 반응형 그리드 - fr, repeat, minmax, max-content, min-content, auto-fit, auto-fill (0) | 2020.03.09 |
CSS 그리드(grid) 기본 (0) | 2020.03.09 |