본문 바로가기

대돌이의 하루/PUBLISHING

css :ntc-child , nth-of-type

ntc-child 일경우엔 같은 라인에 요소를 지정하는것!!

 

ntc-of-type은 같은라인, 같은유형에 있는것을 요소로 지정하는 것이다.

 

ul li span:ntc-child(1){

color : blue;

}

 

만약 동일선상에 있는요소중 첫번째가 span이 아니라면 적용이 되질 않는다 ^^;;

 

 

*추가적으로 뒤에서부터 지우는법

.index_interior_tip ul li:nth-last-of-type(-n + 4) {

    display: none;

  }

 

https://webisfree.com/2015-12-16/[css]-nth-child%EC%99%80-nth-of-type-%EC%84%A0%ED%83%9D%EC%9E%90-%EB%B9%84%EA%B5%90%ED%95%98%EA%B8%B0

 

 

https://mylife365.tistory.com/252

 

[CSS] nth-child (n번째 부터 n번째 까지 css적용)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69..

mylife365.tistory.com

 

http://blog.freezner.com/archives/1875