Difference between tr :nth-child and tr:nth-child

As the title says what’s the difference, with or without the space?
They both produce different results

tr:nth-child (without space)
Table1

tr :nth-child (with space)
Table2

Without the space your selector matches tr elements that are the nth child of their parent. With the space it matches the nth child of a tr element (descendant selector).

1 Like