css
display : flex;
the flex model
main axis - ๋ณธ ์ถ ์ผ์ชฝ์์ ์ค๋ฅธ์ชฝ์ผ๋ก ์ ๋ ฌ
cross axis - ๊ต์ฐจ ์ถ ์์์ ์๋๋ก ์ ๋ ฌ
์ปจํ
์ด๋ ์์์ ๋ณธ์ถ ๋ฐฉํฅ์ ๊ฒฐ์
flex-direction : row-reverse = ๋ณธ์ถ์ ๋ฐฉํฅ์ด ๋ฐ๋๋ก ๋ฐ๋
flex-direction : column = ๋ณธ์ถ์ ๋ฐฉํฅ์ด ์ํ๋ก ๋ฐ๋
์ฃผ์ถ์ ๊ธฐ์ค์ผ๋ก ์ ๋ ฌ
justify-content : space-between, center, flex-end, space-around, etc.
์ฃผ์ถ์ด ์ํ์ผ๋๋ ์๋ก์ด ํ์ ๋ง๋ค์ด ์์๋ฅผ ์ ๋ ฌํ๋ฉฐ
์ฃผ์ถ์ด ์์ง์ผ๋๋ ์๋ก๋ฃฌ ์ด์ ๋ง๋ค์ด ์์๋ฅผ ์ ๋ ฌํ๋ ์์ฑ
๊ฐ๋จํ ๋งํด์ ์ ์ ํ์ค๋ก ๋๊ฒ์ธ์ง ์ฌ๋ฌ ์ค์ ์์ ๊ฒ์ธ์ง ํ๋ ๊ฒ
wrap, reverse, now warp = ๊ต์ฐจ ์ถ(cross axis)์ ๋ณํ
Align-Items = ๊ต์ฐจ์ถ์ ๊ธฐ์ค์ผ๋ก items๊ฐ ์ ๋ ฌ๋๋ค
flex-start ,center,flex-end,etc.
Align-Content = ๊ต์ฐจ์ถ์ ๊ธฐ์ค์ผ๋ก (๋ ์ค ์ด์ ์ผ๋) ๋ผ์ธ ์์ฒด๊ฐ ์ ๋ ฌ๋๋ค
Align-self = ๊ฐ๋ณ์ ์ธ ์์์ ์ ์ฉํ ๋ ์ฌ์ฉ
ex) div:nth-of-type(2) { align-self:center;}
Flex-Basis = ์์์ ์ต์ด ํฌ๊ธฐ ์ง์
Flex-Grow = ์ด์ฉ๊ฐ๋ฅํ ๊ณต๊ฐ ๋ถ๋ฐฐ๋ฅผ ์ง์
Flex-Shrink = ๋ค๋ฅธ ์์์ ๋นํด ์ฐจ์งํ๋ ๊ณต๊ฐ์ ๋น์จ์ ์ค์ด๋ ์ค์
Flex ์๊ธฐ
flex: 2 2 10%
grow shrink basis
flex : 2
grow
flex :10em
30%
basis
Responsive Design
์ฌ์ฉ์์ ์ฌ๋ฌ ํ๊ฒฝ์ ๋ง๊ฒ ์ ์
css์์ ์ด๋ค ์คํ์ผ์ ์ ํ์ ์ผ๋ก ์ ์ฉํ๊ณ ์ถ์ ๋ ์ฌ์ฉํ๋ค.
@media (max-width:800px) (min-width:600px)
{
h1 {
color: purple;
}
}