header { width: 100vw; height: 50px; padding: 10px; display: grid; grid-template-columns: 32% 32% 32%; align-items: center; justify-content: space-between; } .links { justify-self: start; display: flex; align-items: center; gap: 10px; } #headermenubutton { position: absolute; top: 0; left: 0; width: 0; height: 0; overflow: hidden; padding: 0; margin: 0; transition: 0.3s; } .userbuttons { justify-self: end; display: flex; align-items: center; gap: 10px; } header>h1 { justify-self: center; display: flex; align-items: center; } #openroutericon { max-width: 50px; max-height: 50px; border-radius: 10px; margin: 0 5px; } @media screen and (max-width: 400px) { header>h1 { font-size: 15px; } .userbuttons>h1 { font-size: 15px; } } @media screen and (max-width: 600px) { .links { position: absolute; top: 10px; left: 10; height: 0; overflow: hidden; flex-direction: column; transition: 0.3s; } .links.active { height: max-content; background-color: gray; z-index: 10; border-radius: 10px; } #headermenubutton { position: relative; width: fit-content; height: fit-content; overflow: hidden; padding: 10px; /* margin: 0; */ } }