메뉴 건너뛰기

본문시작

2019.05.18 09:28

css 선택자(selector)

조회 수 43 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
Extra Form

No Attached Image

nth-child(), nth-last-child()

-두 선택자는 특정순서가 있는 요소에 사용
-:nth-child()는 앞에서부터 세고 :nth-last-child()는 뒤에서부터 셈
-인터넷 익스플로러 ie9 버전 사용 가능

1) nth-child()

-형제요소중 특정 순서에 있는 요소에 사용

-문법 : nth-child(an+b)

a와 b는 정수이며 n에는 0부터 차례대로 대입됨 
an+b에는 even,odd로 대체할 수 있음,even은 작수요소 odd는 홀수요소가 선택
b로만 사용가능

2) nth-last-child()

 -문법 : nth-last-child(an+b)

nth-child와는 다르게 뒤에서 부터 계산

nth-child와 같이 even,odd 사용



쌓자지식

지식공유

  1. css 선택자(selector)

    Date2019.05.18 By흐미 Reply0 Views43
    Read More
  2. css position 속성에 대해 알아보자.중앙정렬

    Date2019.05.16 By흐미 Reply0 Views62
    Read More
Board Pagination Prev 1 Next
/ 1