# UI-text background color

**URL:** <https://discourse.nodered.org/t/ui-text-background-color/96719>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [23 April 2025 12:37 UTC](https://discourse.nodered.org/t/ui-text-background-color/96719 "2025-04-23T12:37:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [23 April 2025 12:37 UTC](https://discourse.nodered.org/t/ui-text-background-color/96719/1 "2025-04-23T12:37:32Z")

</div>

Hi,  
I set the dynamic properties with this code without problem ...

```auto
output[0] = { ui_update: { label: "ROOM", font: 'Verdana', fontSize: '26', color: 'red' } }

```

I would like to change the background color too, so I created this class:

```auto
.back-text.blue .nrdb-ui-text {
    background-color: blue;
}

```

and I modified the code:

```auto
output[0] = { ui_update: { label: "ROOM", font: 'Verdana', fontSize: '26', color: 'white' }, class: 'back-text.blue' }

```

but without success (also the class must be dynamic)

I don't understand where I'm going wrong, can you help me?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 April 2025 13:08 UTC](https://discourse.nodered.org/t/ui-text-background-color/96719/2 "2025-04-23T13:08:30Z")

</div>

> [@Giamma](#):
>
> ```auto
> .back-text.blue .nrdb-ui-text {
> background-color: blue;
> }
> 
> ```

This is not doing what you think

try changing the class name to `.back-text-blue` and in your data set `class` to `back-text-blue`

---

<div class="post-metadata">

**Author:** ![Giamma](https://avatars.discourse-cdn.com/v4/letter/g/e47774/32.png) [@Giamma](https://discourse.nodered.org/u/Giamma)\
**Post date:** [23 April 2025 13:12 UTC](https://discourse.nodered.org/t/ui-text-background-color/96719/3 "2025-04-23T13:12:22Z")

</div>

Ehm.... works fine, thank you (I've been looking for a solution for only 3 hours...)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 May 2025 13:12 UTC](https://discourse.nodered.org/t/ui-text-background-color/96719/4 "2025-05-07T13:12:36Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
