4
I’m trying to get the DIV father to be filled by all the DIVS daughters, but I’ve tried several things and it doesn’t work. Always ends the father DIV being extrapolated by the daughters.
EDIT: I tested my example code and it looks like this:
DIV PAI = #corpo
;
Daughter divs = all DIVS within #corpo
* {
margin: 0;
padding: 0;
}
nav {
background: blue;
width: 100%;
height: 34px;
display: flex;
justify-content: space-between;
}
#corpo {
width: 100%;
height: 100%;
background: red;
display: flex;
flex-direction: column;
align-items: center;
overflow: visible;
}
#corpo div {
clear:both;
border: 1px solid gray;
border-radius: 8px;
margin-top: 5px;
margin-bottom: 5px;
text-align: center;
width: 200px;
height: 200px;
}
#destaques {
background: yellow;
width: 200px;
height: 30px;
}
.post {
background: lightgray;
}
.post h1 {
margin-bottom: 30px;
font-size: 14px;
}
.post img {
width: 200px;
height: 100px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
#footer {
background: lightgreen;
clear: both;
}
<nav>
<div id="menu">Logo</div>
<div id="logo"><img src="logo.png"></div>
<div div="search">Search</div>
</nav>
<div id="corpo">
<div class="post"> <img src="https://unsplash.it/200/300?random=1" />
<h1>Neutralidade da rede: planos com whatsapp gratuito são ou nao ilegais?</h1>
<p>11 MAR 17</p>
</div>
<div class="post"> <img src="https://unsplash.it/200/300?random=2" />
<h1>Neutralidade da rede: planos com whatsapp gratuito são ou nao ilegais?</h1>
<p>11 MAR 17</p>
</div>
<div class="post"> <img src="https://unsplash.it/200/300?random=3" />
<h1>Neutralidade da rede: planos com whatsapp gratuito são ou nao ilegais?</h1>
<p>11 MAR 17</p>
</div>
<div class="post"> <img src="https://unsplash.it/200/300?random=4" />
<h1>Neutralidade da rede: planos com whatsapp gratuito são ou nao ilegais?</h1>
<p>11 MAR 17</p>
</div>
<div class="post"> <img src="https://unsplash.it/200/300?random=5" />
<h1>Neutralidade da rede: planos com whatsapp gratuito são ou nao ilegais?</h1>
<p>11 MAR 17</p>
</div>
</div>
<div id="footer"> Footer </div>
I didn’t understand. I reproduced here and I didn’t notice anything strange.
– TheBiro
It’s unclear what you want. Do you want the fixed header/footer? group the dots in the body? make the page responsive?
– Tobias Mesquita
It seems to be working properly. What do you mean by extrapolate?
– Leon Freire
I don’t quite understand the mistake you’re making, I tested the code and it seems to be right!
– Willian Tártaro
@Williantártaro tested my example code and took a photo showing the problem.
– Amzero
@Leonfreire What I wanted was for the #body to grow together with the internal Ivs.
– Amzero
@Tobiasmesquita What I wanted was for the #body to grow together with internal Ivs.
– Amzero
@Thebiro tested my example code and took a photo showing the problem.
– Amzero
@Amzero, try applying one
clearflix
in the#corpo
, as an example.:.clearfix:after {
 content:"";
 display:block;
 clear:both;
}
– Tobias Mesquita
@Amzero give a look here https://jsfiddle.net/WillianTartaro/mg9rv9c1/, I added several posts and the body is growing together, but try to put that overflow: self that the guy spoke there in the answer!
– Willian Tártaro
Here grew the #body. Tried to clear the cache? (=
– Aline
@Williantártaro according to your link is normal. However I checked the code in firefox and Chrome and are in the same way as that photo of the post. I’ll reconfirm everything again.
– Amzero
@Aline No. I’ll try.
– Amzero