:nth-child, :nth-of-type 차이

sohyun-park·2022년 5월 1일
1

The pseudo class ":nth-child" is potentially unsafe when doing server-side rendering. Try changing it to ":nth-of-type".

ELEMENT:nth-child

전체 인덱스(순서)를 체크
해당 인덱스에 해당하는 엘리먼트가 없을 경우 선택되지않음

ELEMENT:nth-of-type

해당 엘리먼트의 인덱스(순서)를 체크함

https://nanajeon.com/css-selectors-cheatsheet-details/

1개의 댓글

comment-user-thumbnail
2022년 5월 5일

덕분에 nth-child와 nth-of-type에 대해 공부하고 갑니다!

답글 달기

관련 채용 정보