๊ฐ์
ํผ์ ์จ๋ผ์ธ ๊ฐ์๋ฅผ ๋ณด๋ฉฐ 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๊ฐ ๊ฒน์น๋ค๋ฉด ์ด๋ค ๊ฒ์ ์ ์ฉํ๋ ๊ฐ์ ๋ํ ๋ต์ด cascading์ด๋ค.
๊ทธ ๊ธฐ์ค์ผ๋ก (css ์ ์ธ ์์น, specificity)๊ฐ ์๋ค.
Specificity
specficity๋ผ๋ ๊ฐ๋ ์ ์ด๋ค selector๊ฐ ๋ ๊ตฌ์ฒด์ ์ธ์ง ํ๋จํ๋ ๊ธฐ์ค์ด ๋๋ค.
https://specificity.keegan.st/
Specificity Calculator
Specificity Calculator A visual way to understand CSS specificity. Change the selectors or paste in your own.
specificity.keegan.st
์ ์ฌ์ดํธ์ ๋ค์ด๊ฐ๋ฉด specificity๋ฅผ ๊ณ์ฐํ ์ ์๋ค.
specificity๊ฐ ๋์ selector๊ฐ ์ฐ์ ์์๊ฐ ๋ ๋๋ค.

specificity๋ 3๊ฐ์ง์ ๊ฐ์ด ์์ผ๋ฉฐ (1,0,0) > (0,100,0) ์ด๋ค. class selector๋ ์๋ฌด๋ฆฌ ๋ ธ๋ ฅํด๋ id selector ๋ณด๋ค ์ฐ์ ์์๊ฐ ๋ฎ๋ค
'css' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[tailwind css] Font size, Colors (0) | 2023.10.04 |
---|---|
[tailwind-css] ์ด๊ธฐ์ธํ ํ๊ธฐ (1) | 2023.10.03 |
[css] ๋ ์ด์์ ์ก์ ๋ flex-basis๊ฐ ์๋ width๋ฅผ ์ฐ๋ ์ด์ (0) | 2023.07.28 |
[css]MDN์ ํตํด ์์๋ณด๋ white-space property!! (0) | 2023.03.07 |
[css] width auto์ width %์ ์ฐจ์ด ์ ๋ฆฌ (0) | 2023.01.11 |
๊ฐ์
ํผ์ ์จ๋ผ์ธ ๊ฐ์๋ฅผ ๋ณด๋ฉฐ 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๊ฐ ๊ฒน์น๋ค๋ฉด ์ด๋ค ๊ฒ์ ์ ์ฉํ๋ ๊ฐ์ ๋ํ ๋ต์ด cascading์ด๋ค.
๊ทธ ๊ธฐ์ค์ผ๋ก (css ์ ์ธ ์์น, specificity)๊ฐ ์๋ค.
Specificity
specficity๋ผ๋ ๊ฐ๋ ์ ์ด๋ค selector๊ฐ ๋ ๊ตฌ์ฒด์ ์ธ์ง ํ๋จํ๋ ๊ธฐ์ค์ด ๋๋ค.
https://specificity.keegan.st/
Specificity Calculator
Specificity Calculator A visual way to understand CSS specificity. Change the selectors or paste in your own.
specificity.keegan.st
์ ์ฌ์ดํธ์ ๋ค์ด๊ฐ๋ฉด specificity๋ฅผ ๊ณ์ฐํ ์ ์๋ค.
specificity๊ฐ ๋์ selector๊ฐ ์ฐ์ ์์๊ฐ ๋ ๋๋ค.

specificity๋ 3๊ฐ์ง์ ๊ฐ์ด ์์ผ๋ฉฐ (1,0,0) > (0,100,0) ์ด๋ค. class selector๋ ์๋ฌด๋ฆฌ ๋ ธ๋ ฅํด๋ id selector ๋ณด๋ค ์ฐ์ ์์๊ฐ ๋ฎ๋ค
'css' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[tailwind css] Font size, Colors (0) | 2023.10.04 |
---|---|
[tailwind-css] ์ด๊ธฐ์ธํ ํ๊ธฐ (1) | 2023.10.03 |
[css] ๋ ์ด์์ ์ก์ ๋ flex-basis๊ฐ ์๋ width๋ฅผ ์ฐ๋ ์ด์ (0) | 2023.07.28 |
[css]MDN์ ํตํด ์์๋ณด๋ white-space property!! (0) | 2023.03.07 |
[css] width auto์ width %์ ์ฐจ์ด ์ ๋ฆฌ (0) | 2023.01.11 |