# Hide views column everywhere except one category

**URL:** https://meta.discourse.org/t/hide-views-column-everywhere-except-one-category/101780
**Category:** UX
**Created:** [November 11, 2018, 4:00pm UTC](https://meta.discourse.org/t/hide-views-column-everywhere-except-one-category/101780 "2018-11-11T16:00:28Z")
**Posts on this page:** 3
**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: [November 11, 2018, 4:00pm UTC](https://meta.discourse.org/t/hide-views-column-everywhere-except-one-category/101780/1 "2018-11-11T16:00:28Z")

</div>

I am trying to hide the views column everwhere except for a few categories where I want it visible. I first tried hiding it in the categories where I didn’t want to see it, but then I still want it hidden in latest/new/unread. So I figured I could use `:not` to hide it everywhere except the categories I want it visible, for example:

```
:not(body.category-discussions) {
    .topic-list .views {
        display: none;
    }
}

```

I also tried this:

```
.topic-list .views:not(body.category-discussions) {
	display: none;
}

```

Neither worked. I’m sure I’m missing some stupid simple syntax so forgive my newbness. Thanks!

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [November 13, 2018, 7:59am UTC](https://meta.discourse.org/t/hide-views-column-everywhere-except-one-category/101780/2 "2018-11-13T07:59:53Z")

</div>

> [@davidkingham](#):
>
> ```plaintext
> :not(body.category-discussions) {
> .topic-list .views {
> display: none;
> }
> }
> 
> ```

This doesn’t work because a `:not` psudo-class when used without a simple selector already applies to the `body` tag and so the rule reads

`body` that is not `body`

`:not(.category-discussions)` on the other hand would have worked.

> [@davidkingham](#):
>
> ```plaintext
> .topic-list .views:not(body.category-discussions) {
> display: none;
> }
> 
> ```

This doesn’t work because CSS works from top to bottom, so, in order for your rules to apply, you need to follow the order of the markup

 ![1134](https://global.discourse-cdn.com/meta/original/3X/1/2/126e7a6aee85eec6ce2059318a2394fb252be6a0.png)

try this and see if it works for you.

```plaintext
body:not(.category-discussions) .topic-list .views {
  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: [November 14, 2018, 3:11pm UTC](https://meta.discourse.org/t/hide-views-column-everywhere-except-one-category/101780/3 "2018-11-14T15:11:37Z")

</div>

Thank you for the detailed explanation! That works brilliantly and really helped me understand 👍
