Flexbox
Flexbox๋? flex๋ ์ ์ฐํ, ์ ๊ตฌ๋ถ๋ฌ์ง๋ ์ด๋ผ๋ ๋ป์ผ๋ก ๋ฐ์ค๋ฅผ ์ ์ฐํ๊ฒ ๋๋ฆฌ๊ฑฐ๋ ์ค์ฌ ๋ ์ด์์์ ์ก๋ ๋ฐฉ๋ฒ์ ๋งํ๋ค.
โ๏ธ ๋ถ๋ชจ์ ์ ์ฉํด์ผ ํ๋ flexbox ์์ฑ
display: flex
: ์์ ๋ฐ์ค์ ๋ฐฉํฅ๊ณผ ํฌ๊ธฐ๋ฅผ ๊ฒฐ์ ํ๋ค.flex-direction
: ์ ๋ ฌ ์ถ์ ์ ํ๋ค. ๊ฐ์ผ๋ก๋ row(๊ธฐ๋ณธ๊ฐ), column, row-reverse, column-reverse๊ฐ ์๋ค.flex-wrap
: ํ์ ์์์ ํฌ๊ธฐ๊ฐ ์์ ์์์ ํฌ๊ธฐ๋ฅผ ๋์ผ๋ฉด ์๋์ผ๋ก ์ค๋ฐ๊ฟ์ ํ ๊ฒ์ธ์ง ์ฌ๋ถ๋ฅผ ๊ฒฐ์ ํ๋ค. ๊ฐ์ผ๋ก๋ nowrap(๊ธฐ๋ณธ๊ฐ), wrap, wrap-reverse๊ฐ ์๋ค.justify-content
: ์ถ์ ์ํ๋ฐฉํฅ ์ ๋ ฌ ๋ฐฉ๋ฒ์ ๊ฒฐ์ ํ๋ค. ๊ฐ์ผ๋ก๋ flex-start, flex-end, center, space-between, space-around๊ฐ ์๋ค.align-items
: ์ถ์ ์์ง๋ฐฉํฅ ์ ๋ ฌ ๋ฐฉ๋ฒ์ ๊ฒฐ์ ํ๋ค. ๊ฐ์ผ๋ก๋ flex-start, flex-end, center, space-between, space-around๊ฐ ์๋ค.
โ๏ธ ์์์ ์ ์ฉํด์ผ ํ๋ flexbox ์์ฑ
flex
: flex: grow(ํฝ์ฐฝ ์ง์) shrink(์์ถ ์ง์) basis(๊ธฐ๋ณธ ํฌ๊ธฐ)
๋ก ํํ ๊ฐ๋ฅํ๋ฉฐ, flex-grow
์ ๊ฐ์ ๋ฐฉ๋ฒ์ผ๋ก ๋ฐ๋ก ๊ฐ์ ์ง์ ๊ฐ๋ฅํ๋ค. (๊ธฐ๋ณธ๊ฐ 0, 1, auto)
grow
: ๋ฐ์ค ์์์ ๊ฐ ์์๊ฐ ์ฐจ์งํ๋ ๋น์จ์ ๊ฒฐ์ ํ๋ค.shrink
: ๋ฐ์ค์ ํฌ๊ธฐ๊ฐ ์ค์์ ๋ ๊ฐ ์์๊ฐ ์ค์ด๋๋ ๋น์จ์ ๊ฒฐ์ ํ์ง๋ง ์ ์ฌ์ฉ๋์ง๋ ์๋๋ค.basis
: ์์๊ฐ ๋์ด๋๊ฑฐ๋ ์ค์ด๋ค๊ธฐ ์ ์ ๊ธฐ๋ณธ ํฌ๊ธฐ์ด๋ค.
'๐ถ FE 41๊ธฐ > Review' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[S1U9] JavaScript ๋ฐฐ์ด, ๊ฐ์ฒด (0) | 2022.09.05 |
---|---|
[S1U8] Linux/Git ๊ธฐ์ด (0) | 2022.09.01 |
[U1S5] CSS ๊ธฐ์ด (1) | 2022.08.26 |
[U1S4] HTML ๊ธฐ์ด (0) | 2022.08.25 |
[U1S3] JavaScript ๊ธฐ์ด ์ ์ด๋ฌธ (0) | 2022.08.23 |