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

134
Vistas
Absolute Elements behaving weird in React

I have a simple flex header with flex items which displays absolute divs kinda like a dropdown. It works fin in a normal HTML file but in react, the flex items overflow with a scroll bar forcing the div no to overlap the header itself. The following is the html code

<style>
  .special {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
  }
  .special > * {
    display: relative;
  }
  .resultDiv {
    display: none;
    position: absolute;
    background-color: purple;
    height: 150px;
    width: 80px;
  }
  .special > *:hover .resultDiv {
    display: block;
  }
</style>
 <header class="special" style="background: red">
            <p>Ameer</p>
            <div>
                <form>
                    <input type="search"/>
                </form>
                <div class="resultDiv"></div>  
            </div>
            <nav>
                <div class="resultDiv"></div>
                <a href="#">Home</a>
                <a href="#">Contact</a>
                <a href="#">About</a>
            </nav> 
        </header>

The stling is thesame for react. Here's the code for react component

function DesktopHeader(){
    return(
         <header className="special"style={{background: 'red'}}>
            <p>Ameer</p>
            <div>
                <form>
                    <input type="search"/>
                </form>
                <div className="resultDiv"></div>  
            </div>
            <nav>
                <div className="resultDiv"></div>
                <a href="#">Home</a>
                <a href="#">Contact</a>
                <a href="#">About</a>
            </nav> 
        </header>
    )
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Jus figured out that the flex items were inheriting an overflow: hidden property

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