Learn More About CSS Pseudo Selectors By Building A Balance Sheet - Step 55

Step 55 instructions: Using the same selector syntax, target the 'thelements within your table rows where theclassistotal`

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.

tr class total th

It is because the class=“total” belongs to the tr, it is not the class of th.

Example:
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 :slight_smile:

cause it would mean class “total” belongs to “th” and not “tr”, thats exactly what “teiresa” pointed it out

happy learning :slight_smile: