# How do you change the font size on the battery gauge

**URL:** https://discourse.nodered.org/t/how-do-you-change-the-font-size-on-the-battery-gauge/95292
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [10 February 2025 17:01 UTC](https://discourse.nodered.org/t/how-do-you-change-the-font-size-on-the-battery-gauge/95292 "2025-02-10T17:01:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![thespinmaster](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thespinmaster/32/98737_2.png) [@thespinmaster](https://discourse.nodered.org/u/thespinmaster)
#### Post date: [10 February 2025 17:01 UTC](https://discourse.nodered.org/t/how-do-you-change-the-font-size-on-the-battery-gauge/95292/1 "2025-02-10T17:01:27Z")

</div>

Hi all, Im trying to make the value font size bigger in the battery gauge widget as it’s too small to read.

I have a template node with the following css code but it is not working.

```auto
.nrdb-ui-widget.nrdb-ui-gauge-value span {
    font-size: 20em;
}

```

Does anyone know the magic sauce to make this work?

TIA

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [10 February 2025 18:49 UTC](https://discourse.nodered.org/t/how-do-you-change-the-font-size-on-the-battery-gauge/95292/2 "2025-02-10T18:49:12Z")

</div>

Welcome to the forum @thespinmaster.

I think this might work

```auto
.nrdb-ui-gauge-battery label.nrdb-ui-gauge-battery--bglabel {
    font-size: 3em;
}

```

But what is your base font size?  
If the base font size is 16px, 20em is 320px (I think) which seems quite large.

---

<div class="post-metadata">

### Author: ![thespinmaster](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thespinmaster/32/98737_2.png) [@thespinmaster](https://discourse.nodered.org/u/thespinmaster)
#### Post date: [10 February 2025 21:10 UTC](https://discourse.nodered.org/t/how-do-you-change-the-font-size-on-the-battery-gauge/95292/3 "2025-02-10T21:10:31Z")

</div>

Thanks, that’s so close, it displays the percentage in a larger font, but it also still displays the original font in front. I’m guessing that is what bglable is; a separate background label. The font color is also black and I cannot appear to change it using the color style. Sorry, not sure where I change or view the base font size. I just put 20em in the style code I posted as a random number, to ensure there was a noticeable change.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [10 February 2025 21:19 UTC](https://discourse.nodered.org/t/how-do-you-change-the-font-size-on-the-battery-gauge/95292/4 "2025-02-10T21:19:35Z")

</div>

> [@thespinmaster](#):
>
> I’m guessing that is what bglable is; a separate background label.

Oh yes you are right.  
I remember from my attempt to use the [battery gauge as an LED bar chart](https://discourse.nodered.org/t/ui-gauge-widget-battery-level-percentage-as-a-vertical-led-array/) it displays the label twice, --bglabel and --fglabel.

They are both needed so the value shows up even if the fill % is below the position of the text.

> [@thespinmaster](#):
>
> Sorry, not sure where I change or view the base font size.

No, me neither! 🫤

> [@thespinmaster](#):
>
> The font color is also black and I cannot appear to change it using the color style.

Try using !important in your CSS.

---

<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: [12 March 2025 21:20 UTC](https://discourse.nodered.org/t/how-do-you-change-the-font-size-on-the-battery-gauge/95292/5 "2025-03-12T21:20:24Z")

</div>

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