# How to set color of user-title depending on text in it?

**URL:** <https://meta.discourse.org/t/how-to-set-color-of-user-title-depending-on-text-in-it/24980>\
**Category:** Product Support\
**Created:** [2월 8, 2015, 10:02오후 UTC](https://meta.discourse.org/t/how-to-set-color-of-user-title-depending-on-text-in-it/24980 "2015-02-08T22:02:19Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Martyn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martyn/32/115601_2.png) [@Martyn](https://meta.discourse.org/u/Martyn)\
**Post date:** [2월 8, 2015, 10:02오후 UTC](https://meta.discourse.org/t/how-to-set-color-of-user-title-depending-on-text-in-it/24980/1 "2015-02-08T22:02:20Z")

</div>

Hi guys,

I’ve just installed my Discourse forum, absolutely loving it. The only thing I miss now is that users can’t directly see who is an admin, moderator or developer. I have set the Title (user-title) for these users, but it’s small text one can easily skip over.

So I decided to add some CSS to the user-title class, making it look like this: [http://puu.sh/fEPFb/ed97876ca1.png](http://puu.sh/fEPFb/ed97876ca1.png)

The CSS I used:

```
.user-title{
background: #F55;
border-radius: 3px;
color: #FFF !important;
font-size: 12px!important;
padding-left: 7px;
}

```

I’m wondering now if it’s possible with JavaScript to change the background color depending on the text that’s inside the `<span class="user-title"></span>`. This way I could add different colors depending on the “rank”/title.

Any help would be greatly appreciated 😃

---

_[View the full topic](https://meta.discourse.org/t/how-to-set-color-of-user-title-depending-on-text-in-it/24980)._
