For some reason I cannot get these images to wrap. They overflow past the point of the width I made for my container. Not sure if I'm doing something wrong by putting paragraphs under each image and that's affecting it?
For the images to wrap so I can have 3 on top and 2 right below the 3, each with their title centered right under the image.
.block2 {
background-color: black;
width: 100%;
}
.pics {
display: flex;
}
.pics img {
height: 200px;
width: 300px;
margin: 20px;
flex-shrink: 0;
justify-content: center;
flex-wrap: wrap;
}
.pics p {
flex-wrap: wrap;
}
<div class="block2">
<div class="text2">
<h2>Tea of the Month</h2>
<h1>What's Steeping at The Tea Cozy?</h1>
</div>
<div class="pics">
<img src="images/img-berryblitz.jpg" alt="berryblitz">
<p>Fall Berry Blitz Tea</p>
<img src="images/img-spiced-rum.jpg" alt="spicedrum">
<p>Spiced Rum Tea</p>
<img src="images/img-donut.jpg" alt="donut">
<p>Seasonal Donuts</p>
<img src="images/img-myrtle-ave.jpg" alt="myrtle">
<p>Myrtle Ave Tea</p>
<img src="images/img-bedford-bizarre.jpg" alt="bedford">
<p>Bedford Bizarre Tea</p>
</div>
</div>