Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda