CSS nth-of-type() 셀렉터

(CSS :nth-of-type() 셀렉터에서 넘어옴)

1 개요[ | ]

CSS nth-of-type() Selector
CSS nth-of-type() 셀렉터

2 예시[ | ]

<style>
span:nth-of-type(1) { background: yellow; }
span:nth-of-type(2) { color: red; }
span:nth-of-type(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 }}