728x90
.container {
display: grid;
max-width: 900px;
position: relative;
margin: auto;
grid-template-areas: "head head"
"nav nav"
"info services"
"footer footer";
grid-template-rows: 300px 120px 800px 120px;
grid-template-columns: 1fr 3fr;
}
header {
grid-area: head;
}
nav {
grid-area: nav;
}
.info {
grid-area: info;
}
.services {
grid-area: services;
}
footer {
grid-area: footer;
}
max-width: 900px;
position: relative;
margin: auto;
grid-template-areas: "head head"
"nav nav"
"info services"
"footer footer";
grid-template-rows: 300px 120px 800px 120px;
grid-template-columns: 1fr 3fr;
}
header {
grid-area: head;
}
nav {
grid-area: nav;
}
.info {
grid-area: info;
}
.services {
grid-area: services;
}
footer {
grid-area: footer;
}
head | head |
nav | nav |
info | services |
footer | footer |
- start — aligns grid items to the left side of the grid area
- end — aligns grid items to the right side of the grid area
- center — aligns grid items to the center of the grid area
- stretch — stretches all items to fill the grid area
- start — aligns the grid to the left side of the grid container
- end — aligns the grid to the right side of the grid container
- center — centers the grid horizontally in the grid container
- stretch — stretches the grid items to increase the size of the grid to expand horizontally across the container
- space-around — includes an equal amount of space on each side of a grid element, resulting in double the amount of space between elements as there is before the first and after the last element
- space-between — includes an equal amount of space between grid items and no space at either end
- space-evenly — places an even amount of space between grid items and at either end
align-items
align-items는 세로 축 기준으로 정렬
- start — aligns grid items to the top side of the grid area
- end — aligns grid items to the bottom side of the grid area
- center — aligns grid items to the center of the grid area
- stretch — stretches all items to fill the grid area
align-contents
- start — aligns the grid to the top of the grid container
- end — aligns the grid to the bottom of the grid container
- center — centers the grid vertically in the grid container
- stretch — stretches the grid items to increase the size of the grid to expand vertically across the container
- space-around — includes an equal amount of space on each side of a grid element, resulting in double the amount of space between elements as there is before the first and after the last element
- space-between — includes an equal amount of space between grid items and no space at either end
- space-evenly — places an even amount of space between grid items and at either end
Q.
auto row , 암묵적 명시적 그리드 생성규칙이 헷갈림
728x90
'IT 관련 > 개발(Codecademy)' 카테고리의 다른 글
개인 프로젝트 Reedio 웹페이지 만들기 (0) | 2022.12.25 |
---|---|
Responsive web design : #1 (0) | 2022.12.18 |
Grid 만들기 / grid area와 span 활용 (0) | 2022.12.12 |
Responsive Website 만들기 . 사용환경에 따라 달라지는 화면 적용/flex box에 관해서 + 쉽게 배우는 사이트 추천 (0) | 2022.12.09 |
Color for UI / 코드카데미 프론트엔드 코스 (1) | 2022.12.03 |