Reputation: 405
In a HTML table with class of 'testtable', is there any difference between selecting a element in that table with the following two css selectors?
.testtable td{}
and
td.testtable{}
Upvotes: 0
Views: 173
Reputation: 8651
.testtable td{}
selects a td
that has a parent with the class testtable
, for example:
<table class="testtable">
<td>I'm selected</td>
</table>
td.testtable{}
selects a td
that has the class testtable
, for example:
<table>
<td class="testtable">I'm selected</td>
</table>
Upvotes: 4