.text-overflow{
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  width: 30%;
  height: 150px;
  max-height: 150px;
  background-color: white;
  border: 1px solid black;
}
.sub1{
  box-sizing: border-box;
  width: 100%;
  height: 50%;
  background-color: rgba(165, 90, 90, 0.4);
}
.sub2{
  box-sizing: border-box;
  width: 100%;
  height: 50%;
  background-color: rgba(91, 96, 163, 0.4);
}<section>
    <div class="text-overflow">
        <div class="sub1"></div>
        <div class="sub2">
            <p></p>
        </div>
    </div>
</section>you can see in the following, there is some white space that I don't know where they came from?!
Would anybody help me get rid of this issue?

 
     
     
     
    
` has by default a `margin-top: 1em; margin-bottom: 1em` so even an empty `
` generates space... Change to `p { margin: 0; padding: 1em 0 }` and the space will disappear as padding collapses in an empty `
`.
– Rene van der Lende Jan 29 '22 at 23:49