JSFiddle - React, Tailwind, and code Playground
HTML
<div class="projects">
<div class="project">
<img src="https://via.placeholder.com/150/" style="width:100%">
<div class="text">heading1</div>
</div>
<div class="project2">
<img src="https://via.placeholder.com/150/" style="width:100%">
<div class="text">heading2</div>
</div>
<div class="project3">
<img src="https://via.placeholder.com/150/" style="width:100%">
<div class="text">heading3</div>
</div>
</div>
CSS
.projects {
width: 54%;
position: relative;
margin: auto;
}
.project {
position: relative;
margin: 0 auto;
width: 100%;
max-height: 600px;
min-height: 90px;
}
.project2 {
position: relative;
margin: 0 auto;
width: 100%;
max-height: 600px;
min-height: 90px;
}
.project3 {
position: relative;
margin: 0 auto;
width: 100%;
max-height: 600px;
min-height: 90px;
}
/* Caption text */
.text {
font-family: 'Verdana';
font-weight: bold;
font-size: 36px;
color: balck;
text-decoration: none;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.text2 {
font-family: 'Verdana';
font-weight: bold;
font-size: 36px;
color: black;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.text3 {
font-family: 'Verdana';
font-weight: bold;
font-size: 36px;
color: black;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}