1
I’m creating a post area on my site (Html5 and css3), to make the layout of it I used flexbox, I was able to put the images all right, but I’m having problems to put the title of the posts below these images, because they break the layout, makes a huge mess.
HTML5:
<main>
<h3 class="postagens">Postagens</h3>
<div id="postagens">
<div class="post1">
<img src="../image/postagem.jpg">
<h3>Titulo da primeira imagem</h3>
</div>
<div class="post2">
<img src="../image/postagem.jpg">
</div>
<div class="post3">
<img src="../image/postagem.jpg">
</div>
<div class="post4">
<img src="../image/postagem.jpg">
</div>
<div class="post5">
<img src="../image/postagem.jpg">
</div>
<div class="post6">
<img src="../image/postagem.jpg">
</div>
</div>
</main>
CSS3:
.postagens {
text-transform: uppercase;
font-size:26px;
margin-top:100px;
text-align: center;
}
#postagens {
display:flex;
flex-wrap: wrap;
justify-content: space-between;
}
#postagens img {
border:1px solid red;
width:360px;
height:250px;
margin-left:30px;
margin-right:30px;
margin-bottom:100px;
}
I used several classes for each post because later I will put a manager in php to add the posts in a simpler way
– user160936
Still doesn’t seem to be the best way. Anyway, good luck there.
– Sam