下列选项中,可以选择父元素中的第n个子元素的选择器有()
A: :nth-child(n)
B: :only-child
C: :first-child
D: :nth-last-child(n)
A: :nth-child(n)
B: :only-child
C: :first-child
D: :nth-last-child(n)
举一反三
- CSS3中,如果某个父元素仅有一个子元素,则使用()选择器不能选择这个子元素。 A: :nth-child(1) B: :last-child C: :child D: :only-child
- 要想匹配属于其父元素的第N个子元素,应该选择的选择器是() A: :nth-last-child(n) B: :nth-child(n) C: :first-child D: :last-child
- first -child选择器只能获取父级元素下的一个子元素。
- 智慧职教: CSS3中,:nth-child(n)选择器用于为父元素中的第n个子元素设置样式。
- 下列关于jQuery选择器说法错误的是() A: 使用:only-child选择器只能获取一个子元素 B: pre ~ siblings 选择器与siblings( )方法的使用效果一致 C: first -child与:first 选择器都能用来获取ul下的li元素 D: parent>child选择器与children( )方法使用的效果一致