Design Prototyping in the Browser Design Patterns Image Carousels

tyler borg
tyler borg
9,413 Points

nth-child(2) ???

what is he doing with this nth-child(2) and nth-child(3)? Do you always have to use this for carousel images?

1 Answer

Chidiebere Ekennia
Chidiebere Ekennia
5,944 Points

No, you do not. nth-child(n) - where "n" can be any number or a mathematical equation, is just another css selector. For example, using nth-child(2) would mean you want to select the 2nd child of an html element. Using "div nth-child(2)" would mean the 2nd child element of this div element. In summary, you do not have to use it for carousel images. Any css selector like a class or id could easily replace it.