* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, Helvetica, sans-serif; width: 100%; overflow-x: hidden; } #header { background-color: #f1f1f1; padding: 20px; color: black; text-align: center; font-size: 20px; font-weight: bold; width: 100%; transition: 0.4s ease; display: flex; flex-direction: row; } .menu { display: flex; gap: 20px; width: 100%; justify-content: end; align-items: center; flex-direction: row; flex-wrap: wrap; } .menu.slidedown { color: gray; } .text-white { color: white; } #header.slidedown { color: red; font-size: 20px; background-color: black; position: fixed; top: 0; width: 100%; } .mobile-menu { display: none; } /* @@@@@@@@@@@@@@@@@@ Mobile Side @@@@@@@@@@@@@@@@@@@@@@@@ */ .hamburger-menu { display: none; } .hamburger { background-color: blue; transition: all 0.3s ease; } @media screen and (max-width: 768px) { #header { background-color: gray; position: relative; z-index: 5; } .menu { display: none; } .hamburger-menu { display: flex; justify-content: end; align-items: center; position: absolute; width: 25px; height: 1.5rem; top: 20px; right: 20px; z-index: 6; opacity: 0; /* border: 1px solid red; background-color: pink; */ } .hamburger { position: absolute; width: 25px; height: 0.15rem; top: 30px; right: 20px; background-color: blue; transition: all 0.3s ease; } .hamburger > div:before { content: ""; position: absolute; width: 25px; height: 0.15rem; top: -10px; right: 0; background-color: blue; transition: all 0.3s ease; } .hamburger > div:after { content: ""; position: absolute; width: 25px; height: 0.15rem; top: 10px; right: 0; background-color: blue; transition: all 0.3s ease; } .hamburger-menu:checked + .hamburger { transform: rotate(135deg); } .hamburger-menu:checked + .hamburger > div:before, .hamburger-menu:checked + .hamburger > div:after { top: 0; transform: rotate(90deg); } .mobile-menu a { text-decoration: none; color: black; } .mobile-menu > div:hover { font-size: 25px; padding: 10px 10px; transition: all 0.3s ease; } .mobile-menu { border-top: 1px solid black; height: 180px; width: 100%; overflow: hidden; background-color: gray; display: flex; flex-direction: column; font-size: 25px; gap: 20px; padding: 20px; transform: translateY(-100%); } .mobile-menu.open { transform: translateY(0); transition: all 0.3s ease; } }