# CSS to show element on topics but not category page

**URL:** https://meta.discourse.org/t/css-to-show-element-on-topics-but-not-category-page/117184
**Category:** Support
**Created:** [5월 8, 2019, 3:25오후 UTC](https://meta.discourse.org/t/css-to-show-element-on-topics-but-not-category-page/117184 "2019-05-08T15:25:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [5월 8, 2019, 3:25오후 UTC](https://meta.discourse.org/t/css-to-show-element-on-topics-but-not-category-page/117184/1 "2019-05-08T15:25:59Z")

</div>

I created a simple component to have a banner above topics in a certain category, but I don’t want it to show on the category page, is this possible? Here is my current css

```plaintext
.image-gallery-banner {
    display: none;
}

[class*="image-galleries"] {
    .image-gallery-banner {
        display: flex;
    }
}

```

This is the page I want to hide it from [https://community.naturephotographers.network/c/image-galleries](https://community.naturephotographers.network/c/image-galleries) but have it visible in the category’s topics.

---

<div class="post-metadata">

### Author: ![bts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bts/32/184556_2.png) [@bts](https://meta.discourse.org/u/bts)
#### Post date: [5월 8, 2019, 3:53오후 UTC](https://meta.discourse.org/t/css-to-show-element-on-topics-but-not-category-page/117184/2 "2019-05-08T15:53:53Z")

</div>

I think adding this might do the trick:

```plaintext
.category-header .image-gallery-banner {
    display: none;
}

```

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [5월 8, 2019, 4:10오후 UTC](https://meta.discourse.org/t/css-to-show-element-on-topics-but-not-category-page/117184/3 "2019-05-08T16:10:04Z")

</div>

Thanks, that worked! It does flash up briefly but I’m not sure there’s any way to avoid that.

---

<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: [6월 7, 2019, 4:16오후 UTC](https://meta.discourse.org/t/css-to-show-element-on-topics-but-not-category-page/117184/4 "2019-06-07T16:16:25Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
