# CSS classes for tags

**URL:** <https://meta.discourse.org/t/css-classes-for-tags/58161>\
**Category:** Support\
**Created:** [March 1, 2017, 11:46am UTC](https://meta.discourse.org/t/css-classes-for-tags/58161 "2017-03-01T11:46:58Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [March 1, 2017, 4:28pm UTC](https://meta.discourse.org/t/css-classes-for-tags/58161/5 "2017-03-01T16:28:32Z")

</div>

Yes, some type of CSS “parent selector” would be nice. eg.

```plaintext
td.the_val < tr { 
 font-weight: bold; 
} 
<tr> 
<td></td> 
<td class="the_val"></td> 

```

But alas there is no such thing and AFAIK the technical difficulty involved means there never will be.

However, JavaScript `parentNode()` is capable of going up the DOM

I would not want “every element to have every possible class value” like some apps do (_cough_ WordPress) but I think if adding a class value to an ancestor element so that CSS could “drill down” would help there is a good chance it might just happen à la pr welcome

---

_[View the full topic](https://meta.discourse.org/t/css-classes-for-tags/58161)._
