Home › Forums › CSS › Are div and div:nth-child(1) equivalent? › Reply To: Are div and div:nth-child(1) equivalent?
February 19, 2019 at 9:42 am
#283198
Member
With respect to Beverlyh this
div:nth-child(1)
= the firstdiv
in a group of siblingdiv
elements
Is not quite correct.
div:nth-child(1)
= the first div
which is also the first child of a parent.
https://codepen.io/Paulie-D/pen/exXzpg
For Beverleys exmaple to be true would need to be
div:nth-of-type(1)
= the first div
in a group of sibling div
elements