For some reason when I add images to the < div class="resto2"> the div doesn't increase the size dynamically, instead it simply overrides the footer which shouldn't happen maybe need some help although it seems like a relatively simple problem. I wanted the < div class="resto1" > to not change size only the resto2, according to the amount of images I submit.
JSFiddle LINK: https://jsfiddle.net/mjyk8dzw/1/
<section>
<div class="totall">
<div class="barraesquerda">
<button class="divbotao" id="showit">
<span href="#" class="innerButton">
sobre o projeto
</span>
</button>
<button class="divbotao" id="showit2">
<span href="#" class="innerButton">
equipa e intervenientes
</span>
</button>
</div>
<div class="resto">
<h3
style="font-family: 'Merriweather Sans', sans-serif; font-size: 30px; margin-bottom: 20px; color:#333f50; padding-top: 60px; padding-left: 50px;">
Sobre o projeto
</h3>
<h5
style="font-family: 'Arial Narrow, sans-serif'; font-size: 17px; padding-right: 200px; color:#060633; padding-left: 50px; padding-bottom: 45px;">
<b>duis a mollis urna. In hac habitasse platea dictumst. Vestibulum nisi nunc, elementum et vehicula
vel, rhoncus non metus.
In vel dapibus dolor. Sed at laoreet turpis. Donec nec aliquam velit. Quisque blandit nisi
mauris.</b>
</h5>
</div>
<div class="resto2" style="display: none;">
<h3
style="font-family: 'Merriweather Sans', sans-serif; font-size: 30px; margin-bottom: 20px; color:#333f50; padding-top: 60px; padding-left: 50px;">
Equipa e intervenientes
</h3>
<div style="font-family: 'Arial Narrow, sans-serif'; font-size: 17px; padding-right: 200px; color:#060633; padding-left: 50px; padding-bottom: 20px;">
<section class="product_section layout_padding">
<div style="padding-top: 20px;">
<div class="container">
<div class="row justify-content-center mt-3">
<div class="ml-5 imgList">
<div class="image">
<img class="centrare" style="object-fit: cover; width:225px; height:280px;"
src="https://img.freepik.com/vetores-gratis/ilustracao-do-icone-dos-desenhos-animados-da-meditacao-do-unicornio-fofo_138676-2262.jpg?w=2000" alt="">
</div>
</div>
<div class="ml-5 imgList">
<div class="image">
<img class="centrare" style="object-fit: cover; width:225px; height:280px;"
src="https://i.pinimg.com/564x/32/c7/3a/32c73aaec6d5eff3d183011fec6e43a1.jpg" alt="">
</div>
</div>
<div class="ml-5 imgList">
<div class="image">
<img class="centrare" style="object-fit: cover; width:225px; height:280px;"
src="https://i.pinimg.com/564x/8e/c2/45/8ec245dfe94c87cc3d325970f2907982.jpg" alt="">
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</section>
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="full">
<div class="information_f">
<p><strong style="color: white;">CENTRO</strong></p>
</div>
</div>
</div>
</div>
</div>
</footer>
<script>
$(function() {
$('button#showit').on('click', function() {
$('.resto').show();
$('.resto2').hide();
});
$('button#showit2').on('click', function() {
$('.resto2').show();
$('.resto').hide();
});
});
</script>
</html>
<style>
footer {
background: #333F50;
padding: 90px 0 70px;
}
.totall { width:100%; height: 700px;}
.barraesquerda { background-color: #dbdee1; float: left; width: 22%; height: 100%; position: relative;}
.image { position: relative; margin-right: 1.4rem; margin-bottom: 3rem; color: white; z-index:1; display: flex; justify-content: center;}
.image::after{ content:""; position:absolute; background: linear-gradient(0deg, rgba(39,38,42,1) 0%, rgba(255,255,255,0) 60%); z-index:2; height:100%; width:100%; top:0; left:0;}
</style>