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

154
Vistas
CSS3 Slight indentation when hovering over a nav item

When I hover over the main Icon of the first ul of my nav part, the dropdown menu appears in perfect location, however, when I hover over the sub menu items, a slight indentation appears that I can't seem to find the cause for.

Hovering over the three dots "..." icon:

Hovering over the three dots "..." icon

Hovering over the sub item of the menu:

Hovering over the sub item of the menu

you can clearly see the indentation when I hover over the sub menu which I colored violet upon hover over, which is exactly when the indentation will occur.

.main-navigation {
  position: absolute;
  right: 0px;
  margin-top: -20px;
  margin-right: 15px;
  width: 2em;
  height: 2em;
  color: #D9D9D9;
  border: 1px solid #D9D9D9;
  /* padding: auto; */
  align-content: center;
}

.firstLevelul{
  padding-left: 0;
  list-style: none;
  justify-content:flex-end;
}

.firstLevela{
  display: block;
  text-align: center;
  font: normal small-caps 100 20px/1.8em 'Helvetica Neue';
  text-decoration: none;
}

.firstLevela:hover{
  color: #D9D9D9;
  width: 1.5em;
  height: 1.5em;
}

.secondLevelul{
  display: none;
}

.secondLevela{
  display: block;
}

.secondLevelli:hover{
  background-color: violet;
}

.firstLevelli:hover > .secondLevelul{
  display: block;
  width: 200px;
  height: 200px;
  background-color: white;
  border: 1px solid #D9D9D9;
  margin-left: -169px;
}
<nav class="main-navigation">
  <ul className="firstLevelul">
    <li className="firstLevelli">
      <a href="#" className="firstLevela"><MoreHorizIcon className="editDropDownIcon" /></a>
      <ul className="secondLevelul">
        <li className="secondLevelli"><a className="secondLevela" href="#">sub menu</a></li>
        <li className="secondLevelli"><a className="secondLevela" href="#">sub menu</a></li>
        <li className="secondLevelli"><a className="secondLevela" href="#">sub menu</a></li>
      </ul>
    </li>
  </ul>
</nav>

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

0

This was a little hard to work with as you didn't provide much code.

But I believe the issue is based on your height: 1.5em in the firstLevela:hover selector in CSS.

I made this incredibly rudimentary JSFiddle to demonstrate

https://jsfiddle.net/t7gj9qx2/

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