The >
selector matches direct children only, not descendants.
You want
div.test th, td, caption {}
or more likely
div.test th, div.test td, div.test caption {}
Edit:
The first one says
div.test th, /* any <th> underneath a <div class="test"> */
td, /* or any <td> anywhere at all */
caption /* or any <caption> */
Whereas the second says
div.test th, /* any <th> underneath a <div class="test"> */
div.test td, /* or any <td> underneath a <div class="test"> */
div.test caption /* or any <caption> underneath a <div class="test"> */
In your original the div.test > th
says any <th> which is a **direct** child of <div class="test">
, which means it will match <div class="test"><th>this</th></div>
but won't match <div class="test"><table><th>this</th></table></div>