position : ์์์ ์์น ์ง์ ๊ธฐ์ค์ผ๋ก position๊ณผ ๊ฐ์ด ์ฌ์ฉํ๋ css์์ฑ๋ค์ ๋ชจ๋ ์์๋ฅผ ์ฌ์ฉํ ์ ์๋ค.
(top, bottom, left, right, z-index..)
- static : ๊ธฐ์ค ์์, ํฌ์ง์ ์์
- relative : ์์ ์์ ์ ๊ธฐ์ค
- absolute : ์์น ์ ๋ถ๋ชจ ์์๋ฅผ ๊ธฐ์ค (์์น ์ ๋ถ๋ชจ ์์๋ฅผ ๊ผญ ํ์ธํด์ผํจ!), ๋ถ๋จ๋ฉด์ ๊ฒน์ณ์ง
- fixed : ๋ทฐํฌํธ(๋ธ๋ผ์ฐ์ )๋ฅผ ๊ธฐ์ค
- sticky : ์คํฌ๋กค ์์ญ ๊ธฐ์ค
top, bottom, left, right : ์์์ ๊ฐ ๋ฐฉํฅ๋ณ ๊ฑฐ๋ฆฌ ์ง์
- auto : ๋ธ๋ผ์ฐ์ ๊ฐ ๊ณ์ฐ
- ๋จ์ : px, em. rem ๋ฑ ๋จ์๋ก ์ง์
relative์ absoulte


์์ ์์ ์์ (stack order)
์ด๋ค ์์๊ฐ ์ฌ์ฉ์์ ๋ ๊ฐ๊น๊ฒ ์๋์ง(์์ ์์ด๋์ง) ๊ฒฐ์ !
1. ์์์ position ์์ฑ์ ๊ฐ์ด ์๋ ๊ฒฝ์ฐ ์์ ์์.(๊ธฐ๋ณธ๊ฐ static ์ ์ธ)
2. 1๋ฒ ์กฐ๊ฑด์ด ๊ฐ์ ๊ฒฝ์ฐ, z-index ์์ฑ์ ์ซ์ ๊ฐ์ด ๋์ ์๋ก ์์ ์์.
3. 1๋ฒ๊ณผ 2๋ฒ ์กฐ๊ฑด๊น์ง ๊ฐ์ ๊ฒฝ์ฐ, html์ ๋ค์ ๊ตฌ์กฐ์ผ ์๋ก ์์ ์์. (html ๊ตฌ์กฐ๊ฐ ๋ ๋์ค์ ์์ฑ๋์ด ์์์๋ก)
z-index : ์์์ ์์ ์ ๋๋ฅผ ์ง์
ํฌ์ง์
์ด ์์ผ๋ฉด ์๋ฌด๋ฆฌ ์์๋ ์๊ด์ด ์์,,, ์์ฑ์ด ์ ๋จน๋ ๊ฒ์!
- auto(=0) : ๋ถ๋ชจ ์์์ ๋์ผํ ์์ ์ ๋
- ์ซ์ : ์ซ์๊ฐ ๋์ ์๋ก ์์ ์์(์์๋ ๊ฐ๋ฅ, -1)
์์์ display๊ฐ ๋ณ๊ฒฝ๋จ
- position ์์ฑ์ ๊ฐ์ผ๋ก absolute, fixed๊ฐ ์ง์ ๋ ์์๋ display ์์ฑ์ด block์ผ๋ก ๋ณ๊ฒฝ๋๋ค.
display: flex
flex container
flex items
display : flex container์ ํ๋ฉด ์ถ๋ ฅ(๋ณด์ฌ์ง) ํน์ฑ
- flex : ๋ธ๋ก ์์์ ๊ฐ์ด flex container ์ ์
- inline-flex : ์ธ๋ผ์ธ ์์์ ๊ฐ์ด flex container ์ ์ , ์ํ
flex-direction : ์ฃผ ์ถ์ ์ค์ (์์ง ์ ๋ ฌ, ์ํ ์ ๋ ฌ)
- row : ํ ์ถ (์ข -> ์ฐ), ์ํ
- row-reverse : ํ ์ถ (์ฐ -> ์ข), ์ํ
- column : ์ด ์ถ (์ -> ์๋), ์์ง
- column-reverse : ์ด ์ถ (์๋ -> ์), ์์ง


flex-wrap : flex items ๋ฌถ์(์ค ๋ฐ๊ฟ) ์ฌ๋ถ
- nowrap : ๋ฌต์(์ค๋ฐ๊ฟ)์์
- wrap : ์ฌ๋ฌ ์ค๋ก ๋ฌถ์
- wrap-reverse : wra์ ๋ฐ๋ ๋ฐฉํฅ์ผ๋ก ๋ฌถ์

justify-content : ์ฃผ ์ถ์ ์ ๋ ฌ ๋ฐฉ๋ฒ
- flex-start : flex items๋ฅผ ์์์ ์ผ๋ก ์ ๋ ฌ (๊ธฐ๋ณธ๊ฐ)
- flex-end : flex items๋ฅผ ๋์ ์ผ๋ก ์ ๋ ฌ, ์ฐ์ธก ์ ๋ ฌ ๋จ์ํ ์์ดํ ๋ค์ ์ค๋ฅธ์ชฝ์ผ๋ก ๋ฐ์ด๋ฒ๋ฆฐ๊ฑฐ์
- center : flex items๋ฅผ ๊ฐ์ด๋ฐ ์ ๋ ฌ
- space-between : ๊ฐ flex item ์ฌ์ด๋ฅผ ๊ท ๋ฑํ๊ฒ ์ ๋ ฌ
- space-around : ๊ฐ flex item์ ์ธ๋ถ ์ฌ๋ฐฑ์ ๊ท ๋ฑํ๊ฒ ์ ๋ ฌ

align-content : ๊ต์ฐจ(์์ง) ์ถ์ ์ฌ๋ฌ ์ค ์ ๋ ฌ ๋ฐฉ๋ฒ
- stretch : flex items๋ฅผ ์์์ ์ผ๋ก ์ ๋ ฌ
- flex-start : flex items๋ฅผ ์์์ ์ผ๋ก ์ ๋ ฌ
- flex-end : flex items๋ฅผ ๋์ ์ผ๋ก ์ ๋ ฌ
- center : flex items๋ฅผ ๊ฐ์ด๋ฐ ์ ๋ ฌ
- space-between : ๊ฐ felx item ์ฌ์ด๋ฅผ ๊ท ๋ฑํ๊ฒ ์ ๋ ฌ
- space-around : ๊ฐ flex item์ ์ธ๋ถ ์ฌ๋ฐฑ์ ๊ท ๋ฑํ๊ฒ ์ ๋ ฌ


height๋ฅผ ์ ํํ๊ฒ ์ฃผ์ง ์์ผ๋ฉด ๋์ด๋๋ฒ๋ฆผ... ์ฒซ๋ฒ์งธ ์ปจํ
์ด๋์ ์๋ ๋ฐ์ค์ฒ๋ผ
align-content๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์ค๋ฐ๊ฟ ์ํ์ฌ์ผํ๊ณ flex-wrap์ด ์์ด์ผํ๊ณ ์ ๋ ฌ์ด ๊ฐ๋ฅํ ๋น ๊ณต๊ฐ์ด ์์ด์ผํ๊ณ 2์ค ์ด์์ด ์์ด์ผ ๋์์ ํจ
align-items : ๊ต์ฐจ ์ถ์ ํ ์ค ์ ๋ ฌ ๋ฐฉ๋ฒ
- stretch : flex items๋ฅผ ๊ต์ฐจ ์ถ์ผ๋ก ๋๋ฆผ
- flex-start : flex items๋ฅผ ๊ฐ ์ค์ ์์์ ์ผ๋ก ์ ๋ ฌ
- flex-end : flex items๋ฅผ ๊ฐ ์ค์ ๋์ ์ผ๋ก ์ ๋ ฌ
- center : flex items๋ฅผ ๊ฐ ์ค์ ๊ฐ์ด๋ฐ ์ ๋ ฌ
- baseline : flex items๋ฅผ ๊ฐ ์ค์ ๋ฌธ์ ๊ธฐ์ค์ ์์ ์ ๋ ฌ (๋ฌธ์ ๊ธฐ์ค์ ์ด๋? abcdefg... ์ ์ ๋ง์ถฐ์.... )

order : flex item์ ์์
- 0 : ์์ ์์
- ์ซ์ : ์ซ์๊ฐ ์์ ์๋ก ๋จผ์ , ์์ ์ ๋ ฌ์ด ๋๋ค.

flex-grow : flex item์ ์ฆ๊ฐ ๋๋น ๋น์จ
- 0 : ์ฆ๊ฐ ๋น์จ ์์
- ์ซ์ : ์ฆ๊ฐ ๋น์จ

flex-shrink : flex item์ ๊ฐ์ ๋๋น ๋น์จ
- 1 : flex container ๋๋น์ ๋ฐ๋ผ ๊ฐ์ ๋น์จ ์ ์ฉ
- ์ซ์ : ๊ฐ์ ๋น์จ
- ์์๋ค์ด ์ฐ๊ธ์ด์ง์ง ์๊ฒ ํ๊ธฐ ์ํด์๋ 0์ผ๋ก ์ ์ฉ

flex-basis : flex item์ ๊ณต๊ฐ ๋ฐฐ๋ถ ์ ๊ธฐ๋ณธ ๋๋น
- auto : ์์์ content(๋ด์ฉ) ๋๋น
- ๋จ์ : px, em, rem ๋ฑ ๋จ์๋ก ์ง์



+ position๊ณผ display, css ๋ ์ด์์ ๋ถ๋ถ์ ์์ธํ๊ฒ ํ ๋ฒ ๋ ๊ณต๋ถ๋ฅผ ํด์ผ๊ฒ ๋ค!