tailwind css ๊ณตํ์์ font-size๋ฅผ ์ฐพ์ผ๋ฉด ์์ ๊ฐ์ด ๋์ค๊ณ ๊ทธ๋๋ก element์ class๋ก ๋ฃ์ด์ฃผ๋ฉด ๋๋ค. text color๋ ๋ง์ฐฌ๊ฐ์ง์ด๋ค. ๋ค์ํ ์์์ ์ฌ์ฉํ ์ ์๋ค. ์ด ๋ฐ์๋ bold์ uppercase ๋ฑ๋ ์ฌ์ฉํ ์ ์์ผ๋ ์ฐธ๊ณ ํ๋๋ก ํ์
css
npm์ผ๋ก tailwindcss๋ฅผ ์ค์นํ๋ค ๋๋ ์ ํ๋ธ ์ธ๊ตญ๊ฐ์๋ฅผ ๋ฐ๋ผํ๋๋ฐ src์ styles.css๋ฅผ ๋ง๋ค๊ณ public์ styles.css๋ฅผ ๋ง๋ค์๋๋ฐ tailwindcss๋ก ๋น๋ํ ๊ฒฐ๊ณผ๋ฌผ์ public์ styles.css์์ ์กด์ฌํ๊ฒ ๋๋ค. package.json์ ์์ ๊ฐ์ด ์ถ๊ฐํด์ฃผ๊ณ npx tailwindcss -i ./src/styles.css -o ./public/styles.css --watch ์ ๋ช
๋ น์ด๋ฅผ ์ฌ์ฉํ๋ฉด live server๋ก ๋ฐ๋ก๋ฐ๋ก ์ ์ฉ๋ ์คํ์ผ์ ๋ณผ ์ ์๋ค. src์ ์๋ styles.css์ ์์ ๊ฐ์ด ์ ์ด์ค๋ค. ์์ ๊ฐ์ด ์ถ๊ฐํด์ฃผ๊ณ index.html์์ ํด๋์ค๋ก ์คํ์ผ์ ์ ์ฉํ๋ฉด ๋๋ค.
flex-basis๋ฅผ ์ผ์ ๋ flex-basis๋ ์ต์ ๋๋น๋ ๋ณด์ฅํ์ง๋ง ์ต๋๋๋น๋ ๋ณด์ฅํ์ง ์๋๋ค. ์ปจํ
์ธ ์ ์์ด ๋ง์์ง๋ฉด ๋ ์ด์์ ๋ฐ์ค๊ฐ ์ปค์ง ์ํ์ด ์๋ค. ์ ์ง๋ณด์ ์ธก๋ฉด์์ ์ข์ง ์๋ค. width๋ฅผ ์ผ์๋ ํ
์คํธ์ ํฌ๊ธฐ๊ฐ ๊ธธ์ด์ง๋๋ผ๋ ๋๋น๋ ๊ณ ์ ๋๊ธฐ์ over-flow: hidden ์ ์ธ ์ ์๊ณ , ๋ง์ค์ํ๋ฅผ ์ธ ์ ์๊ฒ ๋๋ค.
See the Pen white-space by Taejin Kim (@kimtaejin3) on CodePen. ์๋ฅผ ๋ณด๋ฉด white space๊ฐ ์์ ๊ฒฝ์ฐ์๋ ํ
์คํธ์ ๊ธธ์ด๊ฐ ๋ถ๋ชจ์ ๋๋น๋ณด๋ค ์ปค์ง๋ฉด ๊ทธ๋๋ก ๋ฒ์ด๋๊ฒ ๋ฉ๋๋ค. ๊ทธ๋ฌ๋ฉด ํ ๋ฒ white space๋ฅผ ๋ง๋ค์ด ๋ด
์๋ค. See the Pen white-space2 by Taejin Kim (@kimtaejin3) on CodePen. ์์ ๊ฐ์ด ๋ถ๋ชจ์ ๋๋น๋ฅผ ๋ฒ์ด๋์ง ์์ผ๋ฉฐ ์ค๋ฐ๊ฟ์ด ๋ฉ๋๋ค. ๋์ฒด ์ ์ค๋ฐ๊ฟ์ด ์๊ธฐ๋ ๊ฑธ๊น์???? css์ white-space ์์ฑ์ ์๋ฉด ๊ถ๊ธ์ฆ์ด ํ๋ฆฌ๊ฒ ๋ฉ๋๋ค. mdn์ผ๋ก ๊ฐ๋ณด์ฃ !! white-space ์์ฑ์ ์ด๊ธฐ๊ฐ์ด normal ์ด๋ผ๊ณ ๋์ด ์์ต๋๋ค. normal์ ์๋ฏธ๋ ๋ฌด์์ผ๊น์? ์๋ฅผ ํตํด norma..
width auto See the Pen css auto and % by Taejin Kim (@kimtaejin3) on CodePen. ์์์ block element๋ฅผ ํ๋ ๋ง๋ค์ด ์ฃผ๊ณ ์์ ๊ธ์๊น์ง ์ฑ์ ๋์๋ค. body์ containg box๋งํผ ๊ฐ๋์ฐฌ ๊ฒ์ ํ์ธํ ์ ์๋ค width ํ๋กํผํฐ์ ๊ธฐ๋ณธ๊ฐ์ด auto์ด๊ธฐ ๋๋ฌธ์ด๊ณ width: auto์ ์๋ฏธ๋ ๋ถ๋ชจ์ containg box๋งํผ์ ์์ญ์ ๋ค ์ฑ์ด๋ค๋ ์๋ฏธ์ด๋ค. See the Pen auto and %02 by Taejin Kim (@kimtaejin3) on CodePen. auto์ ์ ๊ธฐํ ์ ์ ์์๊ฐ์ด margin-left๋ฅผ ์ฃผ๋ฉด, margin ์ ์ ์ฉํจ๊ณผ ๋์์ ๋ถ๋ชจ์์ญ์ ๋ฒ์ด๋์ง ์๊ณ ๊ฝ์ฑ์ด๋ค. ๊ทธ๋ ๋ค๋ฉด %๋ ์ด๋จ๊น? See ..
๊ฐ์ ํผ์ ์จ๋ผ์ธ ๊ฐ์๋ฅผ ๋ณด๋ฉฐ css๋ฅผ ๊ณต๋ถํ์ ๋๋ cascade์ ์๋ฏธ๋ฅผ ์ ํํ๊ฒ ์ดํดํ์ง ๋ชปํ๋ค. ๋ง์ฐํ๊ฒ Selector๊ฐ ๋ ์ ํํ ๊ฒ. ๋ ์๋์ ์์ฑ๋ ๊ฒ์ด ์ฐ์ ์์๊ฐ ๋๋ค๋ ์ง์๋ง ๊ฐ์ง๊ณ ์์๋ค. specificity์ ๊ฐ๋
์ ๋ชจ๋ฅด๊ณ ์์๋ ๊ฒ์ด๋ค. cascading mdn์์ cacading์ ๋ํ ์ค๋ช
์ ์๋์ ๊ฐ๋ค. The cascade is an algorithm that defines how user agents combine property values originating from different sources. ์ฆ, ์ต์ข
์ ์ผ๋ก ์์์ ์ ์ฉ์ด ๋๋ ์คํ์ผ์ ์ด๋ป๊ฒ ์ ํ๋ ๊ฐ์ ๋ํ ์๊ณ ๋ฆฌ์ฆ์ด๋ค. ๋ง์ฝ ์๋ก ๊ฐ์ ์์๋ฅผ ๊ฐ๋ฆฌํค๋ selector์ property๊ฐ ๊ฒน์น๋ค๋ฉด ์ด๋ค..