CSS nth-child() 셀렉터

(Nth-child()에서 넘어옴)

1 개요[ | ]

CSS nth-child() Selector
CSS nth-child() 셀렉터

2 예시[ | ]

<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>

3 같이 보기[ | ]

4 참고[ | ]

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