Step 55 instructions: Using the same selector syntax, target the 'th
elements within your table rows where theclass
My question is why is the selector tr[class=“total”] th instead of
tr th[class=“total”] ?
I don’t understand by the th element is placed at the end and not after tr since it’s a descendant of tr?
Welcome, @yutienlai . Great Question.
It is because the class=“total” belongs to the tr, it is not the class of th.
But, if, for example, you were trying to select the td’s class of current, then it could be tr td[class=“current”].
Hope this helped
hello and welcome to fcc forum
cause it would mean class “total” belongs to “th” and not “tr”, thats exactly what “teiresa” pointed it out