1、
選擇器加載p標(biāo)簽中的第一個元素
p:nth-child(1){
}
選擇器加載父標(biāo)簽內(nèi)的第一個元素 n (所有) 2n 偶數(shù)
p:nth-of-type(1){
}
父級下的直接選中第一個
p:first-child{
}
父級下的直接選中最后一個
p:last-child{
}
p:first-of-type{
}
p:last-of-type{
}
1、
選擇器加載p標(biāo)簽中的第一個元素
p:nth-child(1){
}
選擇器加載父標(biāo)簽內(nèi)的第一個元素 n (所有) 2n 偶數(shù)
p:nth-of-type(1){
}
父級下的直接選中第一個
p:first-child{
}
父級下的直接選中最后一個
p:last-child{
}
p:first-of-type{
}
p:last-of-type{
}