Check out example codes for "select first 5 child css". It will help you in understanding the concepts better.

Code Example 1

li:nth-child(-n+5) {
    color: green;   
}

Learn ReactJs, React Native from akashmittal.com