CSS nth-child for greater than and less than

前端 未结 6 1603
萌比男神i
萌比男神i 2021-01-31 13:24

In my HTML I have,

6条回答
  •  无人共我
    2021-01-31 14:05

    css:

    .wrapper div:nth-child(n+3) {    /* you style*/   }
    

    Reason and Explanation

     (0+3) = 3 = 3rd Element
     (1+3) = 4 = 4th Element
     (2+3) = 5 = 5th Element  and so on ... where n=0,1,2,3.....
    

    Live example >>

提交回复
热议问题