Hello guys,
i'm new to node red, and building my first app.
i have some buttons and instead of the label i want to show an image.
here on the forum i found this code and tweak it (change the name of tab and group and image parameters)
it worked fine.
but the thing is, if i change the order of the buttons, create new one, or delete some, the child number will change, which will affect the image on each button.
is there a way to use the node id instead of child number?
you need to replace tab and group with the name of your tab and group.
for instance my tab is called "main" and the group is called "controls". so for me the code is
Since the node id is unique, it ought to be sufficient to use
<style>
[node-id="03c897154d539be7"] button {
background-color: red !important;
}
</style>
#TAB_GROUP_cards is useful instead of node-id if you are styling all the buttons in a group.
The > before button turns out not to be necessary.
If you are overriding a property that's defined elsewhere in the CSS you need !important. Contrariwise, sometimes you don't. CSS is deep and confusing.