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

121
Visualizações
Center one div and set one div to right inside a container

So i have a container that is flex, and I want to add 2 more div inside it so 1 is centered and one is on the right edge. Can someone pls help. the container must be flex.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can add an empty div inside of parent container at the beginning so you can then use justify-content: space-between on the parent container. Check the code below:

.parent {
  display: flex;
  border: 1px solid green;
  width: 100%;
  justify-content: space-between; /* Add this */
}

.child {
  border: 1px solid red;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
<div class="parent">
  <!-- Empty DIV for the sake of justify-content: space-between -->
  <div></div>
  <div class="child">CENTER</div>
  <div class="child">RIGHT</div>
</div>

about 4 years ago · Santiago Trujillo 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