# Nr dashboard - switch node - change background color

**URL:** <https://discourse.nodered.org/t/nr-dashboard-switch-node-change-background-color/27884>\
**Category:** Dashboard\
**Created:** [6 June 2020 09:56 UTC](https://discourse.nodered.org/t/nr-dashboard-switch-node-change-background-color/27884 "2020-06-06T09:56:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [6 June 2020 09:56 UTC](https://discourse.nodered.org/t/nr-dashboard-switch-node-change-background-color/27884/1 "2020-06-06T09:56:16Z")

</div>

How can I change the background color of a switch node?  
I managed to change the background color of a button node but this method does not work with a switch node.  
Any help appreciated

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [6 June 2020 14:43 UTC](https://discourse.nodered.org/t/nr-dashboard-switch-node-change-background-color/27884/2 "2020-06-06T14:43:21Z")

</div>

I don´t think you can target a specific `ui_switch` if there are several of them in the dashboard. If it is ok for you to change the background of all existing switches then it is possible by targetting the `.nr-dashboard-switch` class.

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [6 June 2020 15:43 UTC](https://discourse.nodered.org/t/nr-dashboard-switch-node-change-background-color/27884/3 "2020-06-06T15:43:50Z")

</div>

Multiple shouldn't be a problem if you know the order of the elements. You can target a specific one with the `:nth-of-type()` selector: [https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type)

---

<div class="post-metadata">

**Author:** ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)\
**Post date:** [8 June 2020 10:47 UTC](https://discourse.nodered.org/t/nr-dashboard-switch-node-change-background-color/27884/4 "2020-06-08T10:47:46Z")

</div>

many thanks!  
As I have only 10+ switches on my mobile phone in one flow your tipp made it and it looks much clearer!

---

<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:** [8 July 2020 10:47 UTC](https://discourse.nodered.org/t/nr-dashboard-switch-node-change-background-color/27884/5 "2020-07-08T10:47:52Z")

</div>

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