CSS nth-child() 셀렉터

Jmnote (토론 | 기여)님의 2015년 10월 20일 (화) 14:45 판 (새 문서: ==개요== ;CSS nth-child() Selector ;CSS nth-child() 셀렉터 <source lang='html5'> <style> span:nth-child(1) { background: yellow; } span:nth-child(2) { color: red; } span:nth-chi...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

CSS nth-child() Selector
CSS nth-child() 셀렉터
<style>
span:nth-child(1) { background: yellow; }
span:nth-child(2) { color: red; }
span:nth-child(3) { background: pink; }
</style>

<div>
    <span>박스1</span>
    <span>박스2</span>
    <span>박스3</span>
    <span>박스4</span>
</div>
<div>
    <p>안녕</p>
    <span>박스1</span>
    <span>박스2</span>
    <span>박스3</span>
    <span>박스4</span>
</div>

</jsfiddle>0foLh6L9</jsfiddle>

2 같이 보기

3 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}