div.toTop { background-color: var(--foregroundColour); border-radius: calc(1rem / 3); bottom: 1rem; cursor: pointer; display: block; height: 1rem; left: calc(100vw / 2 - 6rem / 2); opacity: calc(1 / 2); position: fixed; width: 6rem; z-index: 1; } div.toTop:hover { height: calc(3rem / 2); opacity:1; }