
π€ λ¬Έμ λ§ν¬ : CSS Diner
CSS Selectorμ λν΄ μ°μ΅ν μ μλ μ¬μ΄νΈ
π½οΈ λ¨κ³ 1 : plate

π½οΈ λ¨κ³ 2 : bento

π½οΈ λ¨κ³ 3 : #fancy
π μ°Έκ³ μλ£
λμ§νΈλ Έλ§λ ν΄λμ€(class)μ μμ΄λ(id)μ μ°¨μ΄μ
id : idλ₯Ό μ§μΉν κ²½μ° #(μΎ)μ μ¬μ©νλ€.class : classλ₯Ό μ§μΉν κ²½μ° .(μ )μ μ¬μ©νλ€.
π½οΈ λ¨κ³ 4 : plate > apple

π½οΈ λ¨κ³ 5 : #fancy > pickle

π½οΈ λ¨κ³ 6 : .small

π½οΈ λ¨κ³ 7 : orange.small

π½οΈ λ¨κ³ 8 : bento > orange.small

π½οΈ λ¨κ³ 9 : plate, bento

π½οΈ λ¨κ³ 10 : *

π½οΈ λ¨κ³ 11 : plate *

π½οΈ λ¨κ³ 12 : plate + apple
π μ°Έκ³ μλ£
MDN μΈμ νμ κ²°ν©μ

π½οΈ λ¨κ³ 13 : bento ~ pickle
π μ°Έκ³ μλ£
MDN μΌλ° νμ κ²°ν©μ

π½οΈ λ¨κ³ 14 : plate > apple

π½οΈ λ¨κ³ 15 : plate > :first-child

π½οΈ λ¨κ³ 16 : plate :only-child

π½οΈ λ¨κ³ 17 : .small:last-child

π½οΈ λ¨κ³ 18 : :nth-child(3)

π½οΈ λ¨κ³ 19 : bento:nth-last-child(3)
bentoνκ·Έλ₯Ό κΈ°μ€μΌλ‘ λ€μμ 3λ²μ μ ννλ€.
π½οΈ λ¨κ³ 20 : apple:first-of-type
appleνν¬μ 첫 λ²μ§Έ typeμ μ ννλ€.
π½οΈ λ¨κ³ 21 : :nth-of-type(even)

π½οΈ λ¨κ³ 22 : :nth-of-type(2n+3)
μ°Έκ³ μλ£
MaCoder [CSS] :nth-child :nth-of-type κ°μ ν΄λμ€(μμ¬ ν΄λμ€)
An + B : Aμ Bλ μ μ μ
λ ₯, nμ 0λΆν° μμνλ μμ μ μλ₯Ό μμλλ‘ λμ
νλ€.A * n + Bλ‘ κ³μ°ν κ°μ΄ λμ
λλ€.2 * 0 + 3 = 3 3λ² μ ν β 2 * 1 + 3 = 5 5λ² μ ν
π½οΈ λ¨κ³ 23: plate apple:only-of-type

π½οΈ λ¨κ³ 24 : .small:last-of-type

π½οΈ λ¨κ³ 25 : bento:empty

π½οΈ λ¨κ³ 26 : apple:not(.small)
appleνκ·Έμμ .smallμ΄ μλ μμλ§ μ ννλ€.
π½οΈ λ¨κ³ 27 : [for]
forμΈ κ²λ§ μ ννλ€.
π½οΈ λ¨κ³ 28 : plate[for]

π½οΈ λ¨κ³ 29 : bento[for="Vitaly"]

π½οΈ λ¨κ³ 30 : [for^="Sa"]
forμ΄λ©΄μ μμ±κ°μ΄ Saλ‘ μμνλ κ²λ§ μ ννλ€.
π½οΈ λ¨κ³ 31 : [for$="ato"]
forμ΄λ©΄μ μμ±κ°μ΄ atoλ‘ λλλ κ²λ§ μ ννλ€.
π½οΈ λ¨κ³ 32 : [for*="obb"]
forμ΄λ©΄μ obbκ° ν¬ν¨λ κ²λ§ μ ννλ€.
π½οΈ finish~

β 2022.02.03
β 2022.02.26