16px === 12pt === 1em ๊ฐ์ ํฌ๊ธฐ์ด๋ค.
๋๋ถ๋ถ ์น ๋ธ๋ผ์ฐ์ ์์ ๋ณธ๋ฌธ์ด 16px ๊ธฐ์ค์ด๋ค.
1em ์ font_size ๋๋ฌธ์ โMโ์ ๋๋น๋ฅผ ๊ธฐ์ค์ผ๋ก ํ๋ค.
<span id="label" class="center" ></span>
2.header > p
">"๋ header์ ์์ ์๋ฆฌ๋จผํธ p๋ฅผ ์ ํํฉ๋๋ค.
<header>
<p class="intro"></p>
</header>
3.article + p {...} + ๋ article๊ณผ ์ธ์ ํ ํ์ ์๋ฆฌ๋จผํธ p๋ฅผ ์ ํํฉ๋๋ค
<article>...</article>
<p>...</p> ์ด๊ฑธ ์ ํํจ.
4.section ~ p {โฆ} ~ ๋ section๊ณผ ์ธ์ ํ ํ์ ์๋ฆฌ๋จผํธ p๋ฅผ ๋ชจ๋ ์ ํํฉ๋๋ค.
<section>...</section>
<p></p> // ํธ์ถ.
<p></p> // ํธ์ถ.
5.a[href]{...}
a ์๋ฆฌ๋จผํธ ์ค์์, href ์์ฑ์ ๊ฐ๋ ๋ชจ๋ ์๋ฆฌ๋จผํธ๋ฅผ ์ ํํฉ๋๋ค.
ํ๊ทธ[์์ฑ ์ด ํด๋นํ๋ฉด ํด๋น ์๋ ๋จผํธ ํธ์ถ]
<a href="#"><a/>
6.div[class='center'] {โฆ}
div ์๋ฆฌ๋จผํธ ์ค์์, class๊ฐ center์ธ ์์ฑ์ ๊ฐ๋ ๋ชจ๋ ์๋ฆฌ๋จผํธ๋ฅผ ์ ํํฉ๋๋ค.
<div class='center'> //ํธ์ถ๋จ.
</div>
tem์ ๋๋น(์ฆ๊ฐ, ๊ฐ์, ๊ธฐ๋ณธ)๋ฅผ ์ค์ ํ๋ ๋จ์ถ ์์ฑ์
๋๋ค.
.container{
display:flex; /*๊ธฐ์กด์ item ๋ค์ ๋ถ๋ชจ ์ปจํ
์ด๋ display ์์ฑ์ด flex ๋ก ํ ๋นํด์ผํจ.*/
}
.item {
flex: 1 1 20px; /* ์ฆ๊ฐ๋๋น ๊ฐ์๋๋น ๊ธฐ๋ณธ๋๋น */
flex: 1 1; /* ์ฆ๊ฐ๋๋น ๊ฐ์๋๋น */
flex: 1 20px; /* ์ฆ๊ฐ๋๋น ๊ธฐ๋ณธ๋๋น (๋จ์๋ฅผ ์ฌ์ฉํ๋ฉด flex-basis๊ฐ ์ ์ฉ๋ฉ๋๋ค) */
}
๋ชจ๋ Items์ ์ด ์ฆ๊ฐ ๋๋น(flex-grow)์์ ๊ฐ Item์ ์ฆ๊ฐ ๋๋น์ ๋น์จ ๋ง ํผ ๋๋น๋ฅผ ๊ฐ์ง ์ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด Item์ด 3๊ฐ์ด๊ณ ์ฆ๊ฐ ๋๋น๊ฐ ๊ฐ๊ฐ 1, 2, 1์ด๋ผ๋ฉด,
์ฒซ ๋ฒ์งธ Item์ ์ด ๋๋น์ 25%(1/4)์,
๋ ๋ฒ์งธ Item์ ์ด ๋๋น์ 50%(2/4)๋ฅผ,
์ธ ๋ฒ์งธ Item์ ์ด ๋๋น์ 25%(1/4)์ ๊ฐ์ง๊ฒ ๋ฉ๋๋ค.
Item์ (๊ณต๊ฐ ๋ฐฐ๋ถ ์ ) ๊ธฐ๋ณธ ๋๋น๋ฅผ ์ค์ ํฉ๋๋ค.
๊ฐ์ด auto์ผ ๊ฒฝ์ฐ width, height ๋ฑ์ ์์ฑ์ผ๋ก Item์ ๋๋น๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค.
ํ์ง๋ง ๋จ์ ๊ฐ์ด ์ฃผ์ด์ง ๊ฒฝ์ฐ ์ค์ ํ ์ ์์ต๋๋ค.