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.
â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
?
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!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.