flex box 참고
https://armadillo-dev.github.io/css/what-is-flexbox/
https://heropy.blog/2018/11/24/css-flexible-box/
grid 참고
https://armadillo-dev.github.io/css/understanding-grid-layout/
https://heropy.blog/2019/08/17/css-grid/
container에 사용
display : grid
- grid는 기본이 box 속성
- 한줄씩 차지 한다.
display : inline-grid
- inline 속성으로도 변경 가능
grid-template-rows
그리드 행의 크기 조정 기능
/* Keyword value */
grid-template-rows: none;
/* <track-list> values */
grid-template-rows: 100px 1fr;
grid-template-rows: [linename] 100px;
grid-template-rows: [linename1] 100px [linename2 linename3];
grid-template-rows: minmax(100px, 1fr);
grid-template-rows: fit-content(40%);
grid-template-rows: repeat(3, 200px);
grid-template-rows: subgrid;
grid-template-rows: masonry;
/* <auto-track-list> values */
grid-template-rows: 200px repeat(auto-fill, 100px) 300px;
grid-template-rows: minmax(100px, max-content)
repeat(auto-fill, 200px) 20%;
grid-template-rows: [linename1] 100px [linename2]
repeat(auto-fit, [linename3 linename4] 300px)
100px;
grid-template-rows: [linename1 linename2] 100px
repeat(auto-fit, [linename1] 300px) [linename3];
/* Global values */
grid-template-rows: inherit;
grid-template-rows: initial;
grid-template-rows: revert;
grid-template-rows: unset;
grid-template-columns
그리드 열의 개수 생성 및 크키 조정
/* Keyword value */
grid-template-columns: none;
/* <track-list> values */
grid-template-columns: 100px 1fr;
grid-template-columns: [linename] 100px;
grid-template-columns: [linename1] 100px [linename2 linename3];
grid-template-columns: minmax(100px, 1fr);
grid-template-columns: fit-content(40%);
grid-template-columns: repeat(3, 200px);
grid-template-columns: subgrid;
grid-template-columns: masonry;
/* <auto-track-list> values */
grid-template-columns: 200px repeat(auto-fill, 100px) 300px;
grid-template-columns: minmax(100px, max-content)
repeat(auto-fill, 200px) 20%;
grid-template-columns: [linename1] 100px [linename2]
repeat(auto-fit, [linename3 linename4] 300px)
100px;
grid-template-columns: [linename1 linename2] 100px
repeat(auto-fit, [linename1] 300px) [linename3];
/* Global values */
grid-template-columns: inherit;
grid-template-columns: initial;
grid-template-columns: revert;
grid-template-columns: unset;
grid-template-columns + grid-template-rows
초과되어 지정하지 않은 너비, 높이는 해당 box의 고유의 높이로 설정
fr이란 비율을 설정
repeat(반복횟수, 사이즈) 통해서 반복 표기 가능
grid-template-areas
사각형의 영역을 만들고, 그 영역 내에서 땅따먹기 하듯이 격자에 이름을 지정해서 영역을 나눔
https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas
grid-area를 통해서 이름을 붙여주고,
grid-template-areas를 통해서 구역을 나눠줄 수 있다.
'웹 개발 > 기초' 카테고리의 다른 글
자바스크립트 기본 문법 (0) | 2022.03.14 |
---|---|
[css] 반응형 레이아웃 만들기 (0) | 2022.03.10 |
[CSS] 자주 사용하는 속성 (0) | 2022.03.06 |
[CSS] 단위(em, rem, vw, vh, vmax, vmin) (0) | 2022.03.04 |
[CSS] 선택자 (0) | 2022.03.03 |
[CSS] flex box, grid