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

142
Visualizações
Overflow div if the parent using flex

I want to devide my viewport into 2 section using flex 1. In bottom area require container with overflow item. However isn't work well. Also I have question overflow based on flex parent required fix height eg. 50vh ?. I have try to find solution to match with my problem but it seems none of it suitable.

*{
  margin: 0;
  padding: 0;
}

.container{
  height: 100vh;
  width: 100vw;
  background-color: green;
  display: flex;
  flex-direction: column;
}

.view{
  flex: 1;
  background-color: red;
}

.management{
  flex: 1;
  background-color: blue;
}

header{
  height: 40px;
  background-color: green;
}

p{
  height: 30px;
}

.main-content{
  overflow: auto;
}
<div class="container">
   <div class="view">
      50% viewport
   </div>
   <div class="management">
     <header>Title</header>
     <div class="main-content">
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
     </div>
   </div>
  
 </div>

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

0

see if this is the result you are looking for

*{
  margin: 0;
  padding: 0;
}

.container{
  height: 100vh;
  width: 100vw;
  background-color: green;
  display: flex;
  flex-direction: column;
}

.view{
  height:50%;
  background-color: red;
}

.management{
  display:flex;
  flex-direction:column;
  height:50%;
  background-color: blue;
}

header{
  height: 40px;
  background-color: green;
}

p{
  height: 30px;
}

.main-content{
    height:100%;
    overflow-y:auto;
}
<div class="container">
   <div class="view">
      50% viewport
   </div>
   <div class="management">
     <header>Title</header>
     <div class="main-content">
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>last Item</p>
     </div>
   </div>
  
 </div>

about 4 years ago · Juan Pablo Isaza Relatório

0

The correct answer. The main-container should overflow the items

*{
  margin: 0;
  padding: 0;
}

.container{
  height: 100vh;
  width: 100vw;
  background-color: green;
  display: flex;
  flex-direction: column;
}

.view{
  height: calc(100vh - 50vh);
  background-color: red;
}

.management{
 height: calc(100vh - 50vh);
 width: 100%;
 background-color: blue;

}

header{
  height: 40px;
  background-color: green;
}

p{
  height: 30px;
}

.main-content{
  height: calc(100% - 40px);
  width: 100%;
  overflow-y: auto;
}
<div class="container">
   <div class="view">
      50% viewport
   </div>
   <div class="management">
     <header>Title</header>
     <div class="main-content">
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
       <p>Item</p>
     </div>
   </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