Hello, I am now learning to mess with css, and it falls into a situation where I can not find the answer anywhere, I will be very grateful if anyone can help me.
.pai-com-overflow{
border: 1px solid red;
overflow:hidden;
margin-bottom: 20px;
}
.pai-sem-overflow {
border: 1px solid red;
}
.filho {
float: left;
}
<div class="pai-com-overflow">
<div class="filho">
CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO
</div>
</div>
<div class="pai-sem-overflow">
<div class="filho">
CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO CONTEUDO
</div>
</div>
In this example I have a parent div and a child div, the child div is with float: left
and that's where I did not understand, and the question is:
When I have a child div with float: left
and the parent with overflow:hidden
, the parent div is filled assuming height and width, and without overflow: hidden
not.
Thank you.