I'm sure something similar has been asked a few times, and I tried searching here and tried a few suggestions, but I'm not having any luck. Also, I'm a complete newbie.
In short, I'd like to add text below each image in a grid, and I have 3 images in each row (3 rows). The goal, is to have a name beneath the center of each image (chickens .... yes I know, this is all practice xD).
.image-container {
width: 100%;
}
.row-one,
.row-two,
.row-three {
width: 90%;
margin: 10px auto;
text-align: center;
}
.grid-item {
width: 30%;
height: 310px;
display: inline-block;
margin: 15px;
background-size: cover;
background-position: center;
}
#chicken-one {
background-image: url(blah blah blah link);
}
<section class="ourchicken-section">
<h3 class="section-title">Our Chickens</h3>
<div class="image-container">
<div class="row-one">
<div class="grid-item" id="chicken-one"></div>
<div class="grid-item" id="chicken-two"></div>
<div class="grid-item" id="chicken-three"></div>
</div>
</div>
<div class="image-container">
<div class="row-two">
<div class="grid-item" id="chicken-four"></div>
<div class="grid-item" id="chicken-five"></div>
<div class="grid-item" id="chicken-six"></div>
</div>
</div>
<div class="image-container">
<div class="row-three">
<div class="grid-item" id="chicken-seven"></div>
<div class="grid-item" id="chicken-eight"></div>
<div class="grid-item" id="chicken-nine"></div>
</div>
</div>
</section>
and so on...
Should I be adding a second div in the HTML, then a <p>
element below each chicken div and their name? I tried that, but it pushes the images out of alignment.
Maybe I'm just too new and need to learn more.