# Custom css inside a post / adding custom classes

**URL:** https://meta.discourse.org/t/custom-css-inside-a-post-adding-custom-classes/143072
**Category:** Development
**Created:** [March 2, 2020, 11:55am UTC](https://meta.discourse.org/t/custom-css-inside-a-post-adding-custom-classes/143072 "2020-03-02T11:55:09Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [March 2, 2020, 12:19pm UTC](https://meta.discourse.org/t/custom-css-inside-a-post-adding-custom-classes/143072/3 "2020-03-02T12:19:50Z")

</div>

> [@Chris\_McLaughlin](#):
>
> I’ve [seen](https://meta.discourse.org/t/adding-custom-class-to-img-tag/21425/7) that any non-whitelisted `class` es are stripped out

Styles/classes are stripped out, but you can use `data-theme-*` attributes to target things in posts:

```plaintext
<div data-theme-bot>
   Content here
</div>

```

For example, this paragraph is wrapped in a data-theme-bot div

And then in a theme, target it like:

```css
div[data-theme-bot] {
  background-color: red;
}

```

---

_[View the full topic](https://meta.discourse.org/t/custom-css-inside-a-post-adding-custom-classes/143072)._
