# 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:** 1

<div class="post-metadata">

**Author:** ![Chris\_McLaughlin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chris_mclaughlin/32/171502_2.png) [@Chris\_McLaughlin](https://meta.discourse.org/u/Chris_McLaughlin)\
**Post date:** [March 2, 2020, 11:55am UTC](https://meta.discourse.org/t/custom-css-inside-a-post-adding-custom-classes/143072/1 "2020-03-02T11:55:09Z")

</div>

Is it possible to give a \<div\> inside a post some custom styling?  
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, and I’ve tried adding`style=` to my divs and spans to no avail , so does anyone know if there’s a way to do that?

Basically I have a bot that posts from an internal tool and I’d like to have it post with something that looks like the tool to make it obvious that it’s not a regular disourse post, something like this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/1/f19e2334a1c3497d43002d7645db04d457ce7ad0.png)

It’s got a couple of nested divs/spans to make it look nice and they each have their own associated css.  
Ideally if the bot could post something like this:

```plaintext
<div class="mytool">
  <div class="item">
    <div class="name">Machine64</div>
    <div class="message">Top Secret operation has executed sucessfully</div>
  </div>
  <div class="item">
    <div class="name">Device 08</div>
    <div class="message">Test operation failed at 16:22</div>
  </div>
</div>

```

those extra `class`es would be specified in the global discourse css, but even if I could lump all my styling into `style` tags, that would solve my problem.

Any ideas on how I could do this? Thanks!

---

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