λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
CSSπŸ”§/css μ„ νƒμž&κ°€μƒν΄λž˜μŠ€,κ³΅ν†΅ν΄λž˜μŠ€

CSS :nth-child(n) even, 2n 짝수번째 μ„€μ •

by hyojinny 2022. 10. 28.

1μ—΄λ‘œ λ‚˜μ—΄λœ 컨텐츠듀을

μ§μˆ˜μš”μ†Œλ§Œ 였λ₯Έμͺ½μœΌλ‘œ κ°€κ²Œ 재배치 

 

 

κ³΅ν†΅ν΄λž˜μŠ€λ‘œ λ™μ•Œν•œ ν΄λž˜μŠ€μ— :nth-chiled(even)

.about_page .desc_wrap:nth-child(even) .desc_img {
  float: right;
}
 
.about_page .desc_wrap:nth-child(even) .txt_wrap {
  float: right;
}
 
 
λ˜λŠ”
κ³΅ν†΅ν΄λž˜μŠ€λ‘œ λ™μ•Œν•œ ν΄λž˜μŠ€μ— :nth-chiled(2n)
 
 
.about_page .desc_wrap:nth-child(2n) .desc_img {
  float: right;
}
  
.about_page .desc_wrap:nth-child(2n) .txt_wrap {
  float: right;
}

 

nth-child λŠ” ν˜•μ œμš”μ†Œλ“€μ˜ 선택이 κ°€λŠ₯ν•œ κ°€μƒμ„ νƒμžμ΄λ‹€. 

 

짝수 even / 2n 

ν™€μˆ˜ odd / 1n

λŒ“κΈ€