# Adding classes to links in post body for styling

**URL:** <https://meta.discourse.org/t/adding-classes-to-links-in-post-body-for-styling/131027>\
**Category:** Development\
**Created:** [October 15, 2019, 10:13am UTC](https://meta.discourse.org/t/adding-classes-to-links-in-post-body-for-styling/131027 "2019-10-15T10:13:17Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![alank](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alank](https://meta.discourse.org/u/alank)\
**Post date:** [October 15, 2019, 10:13am UTC](https://meta.discourse.org/t/adding-classes-to-links-in-post-body-for-styling/131027/1 "2019-10-15T10:13:17Z")

</div>

Is there a way to get around Discourse reformatting an Anchor as we would like it displayed as a button and therefore would like a specific style.

the post is posted with the .raw property (I’ve tried to use ‘.cooked’ but this doesn’t seem supported despite what the API states).

posting `<a aria-label=“homepage-link” href=“http://blablabla...“>View Homepage</a>`

And it is displayed in the Discourse Post.. or Category description as

`<div class="cooked"><a>View Homepage</a></div>`

**I’ve also tried**

`[View this page][http://blablabla]`

And this was converted to:

`<div class="cooked"><a href="http://blablabla" class="onebox" target="_blank">http://blablabla</a></div>`

However if I could simply have:

`<div class="cooked"><a href="http://blablabla" class="onebox" target="_blank">View this page</a></div>`

I could possibly target it via CSS from the body element to apply the CSS button style we need.

---

_[View the full topic](https://meta.discourse.org/t/adding-classes-to-links-in-post-body-for-styling/131027)._
