# Highlighting certain topics in topic list view

**URL:** https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924
**Category:** Support
**Created:** [02.Апрель.2016 10:58:02 UTC](https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924 "2016-04-02T10:58:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![tomwrench](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tomwrench/32/54576_2.png) [@tomwrench](https://meta.discourse.org/u/tomwrench)
#### Post date: [02.Апрель.2016 10:58:02 UTC](https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924/1 "2016-04-02T10:58:02Z")

</div>

I’m wanting to highlight topics with a certain tag with a different background colour in the topic list view. In my case, I’ve tagged “advertisement” type topics with ‘advertisement’ and I would like them to be highlighted a light yellow on the topic list view to stand out, as per my mockup below. Would there be a CSS hack (or otherwise) to achieve this?

 ![](https://global.discourse-cdn.com/meta/original/3X/4/d/4d268a31dd24300bc725928298194e1f0624e26a.png)

Thanks

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12.Октябрь.2016 07:49:58 UTC](https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924/2 "2016-10-12T07:49:58Z")

</div>

I am not sure this is possible with tags but there are category CSS classes per row.

---

<div class="post-metadata">

### Author: ![Hammad\_Abbasi](https://avatars.discourse-cdn.com/v4/letter/h/90db22/32.png) [@Hammad\_Abbasi](https://meta.discourse.org/u/Hammad_Abbasi)
#### Post date: [12.Октябрь.2016 12:29:40 UTC](https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924/3 "2016-10-12T12:29:40Z")

</div>

Tags have title attribute so you can use css selector (badge-category[title=“tag-title.”] ) to apply any style on them but if you want to highlight the entire row then you have to select parent which i don’t think is possible via css.

I would use javascript to achieve this

```plaintext
var allrows =document.querySelectorAll("a[title=\"new topic\"]");
for( i in allrows) {allrows[i].parentNode.parentNode.style.backgroundColor="#FFFFE0";}

```

I was able to highlight topics tagged with “new”

 ![](https://global.discourse-cdn.com/meta/original/3X/d/7/d75f9555026b1059e1439b6b07d7bf7ad5fbc671.png)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [17.Март.2019 07:57:46 UTC](https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924/4 "2019-03-17T07:57:46Z")

</div>



---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [18.Март.2019 10:47:03 UTC](https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924/5 "2019-03-18T10:47:03Z")

</div>

@maja if the data is already being serialized to the client, can you ensure the topics have a class for each tags (eg. `tag-<name>`) in the topics list view?

---

<div class="post-metadata">

### Author: ![maja](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maja/32/129533_2.png) [@maja](https://meta.discourse.org/u/maja)
#### Post date: [20.Март.2019 16:21:17 UTC](https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924/7 "2019-03-20T16:21:17Z")

</div>

Added in

[https://github.com/discourse/discourse/commit/5d20d02ffce1e5fdc1976bf79b977e710d5d6e0d](https://github.com/discourse/discourse/commit/5d20d02ffce1e5fdc1976bf79b977e710d5d6e0d)

---

<div class="post-metadata">

### Author: ![maja](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maja/32/129533_2.png) [@maja](https://meta.discourse.org/u/maja)
#### Post date: [20.Март.2019 16:21:24 UTC](https://meta.discourse.org/t/highlighting-certain-topics-in-topic-list-view/41924/8 "2019-03-20T16:21:24Z")

</div>


