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

144
Visualizações
How to wrap multiple div without changing inner div posittion

So I'm having this issue, I'm coding a basic website using NextJS, this is an example of my code

I have a set of div like this with relative positioning

<div>one</div>
<div>two</div>
<div>three</div>

output it looks something like this

one two three

Now I want to wrap all 3 divs inside another div with absolute positioning so I can change its position freely across the screen

<div>
  <div>one</div>
  <div>two</div>
  <div>three</div>
</div>

But doing that will change inner div layout to this

one
two
three

So basically, how do I wrap multiple divs inside another div without changing inner div position?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Try this in your CSS code for the inner divs:

display: inline-block;

and this for the outer div:

width: fit-content;

See this jsfiddle demonstration

about 4 years ago · Juan Pablo Isaza Relatório

0

Something like this:

.parent{
  position: absolute;
  bottom: 0px;
}

.child{
  display: inline-block
}
<div class="parent">
  <div class="child">One</div>
  <div class="child">Two</div>
  <div class="child">Three</div>
</div>

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