It turns out that I have a section where I'm putting a kind of image gallery. The parent container of all has a height of 600px, and inside has two other containers that contain the images, the problem is that as you increase the images, obviously the container of the images changes alto.
How could I make the parent container, ie the section, automatically enlarge depending on the content?
Thanks
/* PORTFOLIO */
.portfolio{
height: 500px;
background:#f2f2f2;
padding:20px;
}
.portfolioTitulo{
text-align: center;
margin-top: 15px;
margin-bottom: 20px;
font-weight: 300;
font-size: 35px;
}
.trabajo{
width: 30%;
margin-bottom: 20px;
margin-right:3px;
}
.thumb{
width: 100%;
margin-bottom: 10px;
}
.thumb img {
width: 100%;
vertical-align: top;
border-radius: 3px;
}
.contenedorPortfolio2{
display: flex;
flex-direction:row;
flex-wrap:wrap;
justify-content:center;
}
<section class="portfolio">
<div class="contenedorPortfolio">
<h1 class="portfolioTitulo">Portfolio</h1>
<div class="contenedorPortfolio2">
<div class="trabajo">
<div class="thumb">
<img src="http://lorempixel.com/500/500/">
</div>
</div>
<div class="trabajo">
<div class="thumb">
<img src="http://lorempixel.com/500/500/">
</div>
</div>
<div class="trabajo">
<div class="thumb">
<img src="http://lorempixel.com/500/500/">
</div>
</div>
<div class="trabajo">
<div class="thumb">
<img src="http://lorempixel.com/500/500/">
</div>
</div>
<div class="trabajo">
<div class="thumb">
<img src="http://lorempixel.com/500/500/">
</div>
</div>
<div class="trabajo">
<div class="thumb">
<img src="http://lorempixel.com/500/500/">
</div>
</div>
</div>
</div>
</section>