JSFiddle - React, Tailwind, and code Playground
by Francisco Maria Calisto
HTML
<figure>
<img src="foo.jpg" alt="">
<figcaption>
<h5>Name:<span>xyz</span></h5>
<h6>Location:<span>xyz</span></h6>
</figcaption>
</figure>
CSS
.container-of_the-cards{ /* This is actually a li-element with some different specs, but for illustrational purposes I guess this one is easier */
width: 100%;
display: inline-block;
}
figure{
box-sizing: border-box;
width: 30%;
height: 300px;
margin-right: 1.1%;
overflow: hidden;
}
figure img{
width: 100%;
height: 100%;
position: absolute;
}
figcaption{
box-sizing: border-box;
margin: 0 20px;
background: blue;
margin-top: -280px;
}
figcaption h5{
top-margin:30px;
}
figcaption h6{
top-margin:80px;
}