.node-text { position: absolute; width: 100px; height: 40px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; /*border: 1px solid red;*/ transform: translate(-50%, -50%); } .output{ font-weight: bold; color: var(--offwhite); } .node-text:not(.output) { color: transparent; } .node-text:not(.output):hover { color: var(--offwhite); }