+ 8
li:nth-child(1) { animation:txt1 2s ease-in-out infinite; }
what is the work of nth-child in this code ?? I saw this sector in code play ground
6 Answers
+ 6
I didn't understand
+ 6
thx
+ 2
eg:
ul li:nth-child(2){
color:#f00;
}
mean that only second li will be red
+ 1
first li element in ul get animation
+ 1
nth-child is a selector similar as first-child or last-child. nth-child is a selector that let you choose a child inside a HTML tag, if you have 10 child inside a tag and you don't want to get the first one or the last one. nth-child is the correct choice, you can say that you want the 3rd child that way nth-child(3).
0
np