Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

97
Vistas
Navigation menu is showing on top of the website, even though it's translated it up

Here is a video of the issue. And not sure why this problem is occurring when I decrease the height in responsive design mode. Beginner web developer, any help appreciated.

.main-navigation {
  position: absolute;
  height: 100%;
  top: -100%;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fffefc;
  transform: translateY(0);
  transition: all 500ms;
}

/* modifier class*/
.navigation-open {
  transform: translateY(100%);
}
const closeButton = document.querySelector(".close-nav-btn");
const openButton = document.querySelector(".open-nav-btn");
const nav = document.querySelector(".main-navigation");

closeButton.addEventListener("click", () => {
  nav.classList.remove("navigation-open");
});

openButton.addEventListener("click", () => {
  nav.classList.add("navigation-open");
});

Let me know if further info is required to help out. (:

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This top: -100% you have means "move the navigation to the top of the containing block's height". When you resize, the containing block's height is becoming smaller than your navigation's height, which is causing this overflow you see. A solution could be doing as below.

Notice I'm animating the height of the navigation, instead its top property.

.main-navigation {
  position: fixed;
  top: 0;
  left: 0;
  width:100%;
  height:0;
  overflow:hidden;
  background-color: #fffefc;
  transition: all 500ms;
}

.navigation-open {
   overflow:auto;
   height: 100vh;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda