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

I was wondering why this space before .description is necessary. Why does tr.data th.desription not work? } Why does it have to be tr.data th .description?
Here is the functioning code below:
tr.data th.description {
display: block;}
and I am supposed to be targeting:
Create a tr.data th .description selector to target the elements with the class set to description that are within your th elements in your .data table rows.

Let me ask you this. What does tr.data mean in CSS? Explain in words what this is targeting.

1 Like

‘tr.data’ is selecting the table rows that have the class of ‘data’, right? but then, why can’t I use ‘th.description’ to target the elements with the class set to description that are within the th elements? I am guessing the space is somehow making it so that I am not selecting tr.data AND ALSO selecting th.decription elements, instead it is making it so that I am only selecting the “elements with the class set to description that are within your th elements in your .data table rows.” but I don’t really understand why the space has that effect T-T

Perfect. You are exactly right here. The important thing to note here is that the class of data needs to be on the tr element.

If tr.data means select all table rows that have the class of data, then wouldn’t th.description mean select all table headings that have the class of description? Do any of the table headings have a class on them? I’m not seeing any. So I don’t think th.description is relevant here.

Look at the ruleset above this one:

tr.data th {
  text-align: left;
  padding-top: 0.3rem;
  padding-left: 0.5rem;
}

Why did you put a space between tr.data and th?

1 Like

AAH. Aah. Thank you. It is so simple yet I think I just got in tutorial mode just completing each step and wasn’t sa focused on the product as I shohuld have been. Thanks again!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.