# Apply a class to a text node

**URL:** <https://discourse.nodered.org/t/apply-a-class-to-a-text-node/99991>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [19 December 2025 15:39 UTC](https://discourse.nodered.org/t/apply-a-class-to-a-text-node/99991 "2025-12-19T15:39:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AloisBachmeier](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aloisbachmeier/32/82319_2.png) [@AloisBachmeier](https://discourse.nodered.org/u/AloisBachmeier)\
**Post date:** [19 December 2025 15:39 UTC](https://discourse.nodered.org/t/apply-a-class-to-a-text-node/99991/1 "2025-12-19T15:39:59Z")

</div>

Doing my first steps into Dashboard 2.  
The dashboard does not any reaction to font-size: --px. What I'm doing wrong?

```auto
[
    {
        "id": "8ea5dbdfb7c2ac3f",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "8cf2ee1796caf35f",
        "type": "ui-template",
        "z": "8ea5dbdfb7c2ac3f",
        "group": "",
        "page": "9ea3ac9ca0cf2aae",
        "ui": "",
        "name": "",
        "order": 3,
        "width": 0,
        "height": 0,
        "head": "",
        "format": "\n .Schrift{\n font-size: 30px; \n color: red;\n font-weight: 600;\n }\n",
        "storeOutMessages": true,
        "passthru": true,
        "resendOnRefresh": true,
        "templateScope": "page:style",
        "className": "",
        "x": 730,
        "y": 320,
        "wires": [
            []
        ]
    },
    {
        "id": "2ff9a7b24f8598fb",
        "type": "ui-text",
        "z": "8ea5dbdfb7c2ac3f",
        "group": "e6351cb4935bc963",
        "order": 1,
        "width": 0,
        "height": 0,
        "name": "Schrift-Test",
        "label": "Schrift-Test",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "style": false,
        "font": "Arial,Arial,Helvetica,sans-serif",
        "fontSize": "24",
        "color": "#267fdf",
        "wrapText": false,
        "className": "Schrift",
        "value": "payload",
        "valueType": "msg",
        "x": 730,
        "y": 400,
        "wires": []
    },
    {
        "id": "fc542f9aeb4bdef2",
        "type": "inject",
        "z": "8ea5dbdfb7c2ac3f",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "on",
        "payloadType": "str",
        "x": 430,
        "y": 380,
        "wires": [
            [
                "2ff9a7b24f8598fb"
            ]
        ]
    },
    {
        "id": "86820f4aa8c30959",
        "type": "inject",
        "z": "8ea5dbdfb7c2ac3f",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "off",
        "payloadType": "str",
        "x": 430,
        "y": 420,
        "wires": [
            [
                "2ff9a7b24f8598fb"
            ]
        ]
    },
    {
        "id": "9ea3ac9ca0cf2aae",
        "type": "ui-page",
        "name": "Flow 1",
        "ui": "2bcd223180e211a8",
        "path": "/page2",
        "icon": "home",
        "layout": "grid",
        "theme": "1cbfd3a7a1359037",
        "breakpoints": [
            {
                "name": "Default",
                "px": "0",
                "cols": "5"
            },
            {
                "name": "Tablet",
                "px": "576",
                "cols": "6"
            },
            {
                "name": "Small Desktop",
                "px": "768",
                "cols": "9"
            },
            {
                "name": "Desktop",
                "px": "1024",
                "cols": "12"
            }
        ],
        "order": 2,
        "className": "",
        "visible": "true",
        "disabled": "false"
    },
    {
        "id": "e6351cb4935bc963",
        "type": "ui-group",
        "name": "Test",
        "page": "9ea3ac9ca0cf2aae",
        "width": "3",
        "height": "5",
        "order": 1,
        "showTitle": true,
        "className": "",
        "visible": "true",
        "disabled": "false",
        "groupType": "default"
    },
    {
        "id": "2bcd223180e211a8",
        "type": "ui-base",
        "name": "Mein Dashboard",
        "path": "/dashboard",
        "appIcon": "",
        "includeClientData": true,
        "acceptsClientConfig": [
            "ui-notification",
            "ui-control"
        ],
        "showPathInSidebar": false,
        "headerContent": "page",
        "navigationStyle": "default",
        "titleBarStyle": "default",
        "showReconnectNotification": true,
        "notificationDisplayTime": 1,
        "showDisconnectNotification": true,
        "allowInstall": false
    },
    {
        "id": "1cbfd3a7a1359037",
        "type": "ui-theme",
        "name": "Standardthema",
        "colors": {
            "surface": "#097479",
            "primary": "#0094ce",
            "bgPage": "#111111",
            "groupBg": "#333333",
            "groupOutline": "#cccccc"
        },
        "sizes": {
            "density": "default",
            "pagePadding": "12px",
            "groupGap": "12px",
            "groupBorderRadius": "4px",
            "widgetGap": "12px"
        }
    },
    {
        "id": "496dfe812fc215a4",
        "type": "global-config",
        "env": [],
        "modules": {
            "@flowfuse/node-red-dashboard": "1.30.0"
        }
    }
]

```

---

<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:** [19 December 2025 16:02 UTC](https://discourse.nodered.org/t/apply-a-class-to-a-text-node/99991/2 "2025-12-19T16:02:03Z")

</div>

I think your font-size declaration is being overridden by a rule elsewhere. You need to make the selector a bit more specific. Try this

```auto
  .Schrift label, .Schrift span{
    font-size: 30px;  
    color: red;
    font-weight: 600;
  }

```

---

<div class="post-metadata">

**Author:** ![AloisBachmeier](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aloisbachmeier/32/82319_2.png) [@AloisBachmeier](https://discourse.nodered.org/u/AloisBachmeier)\
**Post date:** [19 December 2025 21:47 UTC](https://discourse.nodered.org/t/apply-a-class-to-a-text-node/99991/3 "2025-12-19T21:47:58Z")

</div>

thanks ! 🙂

---

<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:** [2 January 2026 21:48 UTC](https://discourse.nodered.org/t/apply-a-class-to-a-text-node/99991/4 "2026-01-02T21:48:04Z")

</div>

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