为什么nth-child(1)是选择全部元素
![]() ![]() 学习之星
|
51zxw9058
展开
|
![]() ![]() 打卡Lv5
|
昆明翰林
展开
$("#box div:nth-child(1)")//选择#box中第1个div $("#box div:nth-child(5)")//选择#box中第5个div $("div:nth-child(10)")//选择第10个div $("#box div:first")//选择#box中第1个div $("#box div:last")//选择#box中最后1个div $("#box div:nth-child(2n+1)")//择#box中奇数div $("#box div:nth-child(2n)")//择#box中偶数div ("#box div:nth-child(n+3):nth-child(-n+8)")//选择#box中3到8的div |
![]() |
game_svip
展开
|
![]() |
OliGit
展开
|
本站有权保留或删除有争议评论。 参与本评论即表明您已经阅读并接受上述条款。