<div class="cont">
<figure class="element">
<img class="element__image" src="http://ewigkeit.ucoz.club/codepen/poster-1.jpg" alt="picture" />
<figcaption class="element__figcaption">
<h5 class="element__figcaption__title">
<a href="#" class="element__link">ON THE 11TH FLOOR OF MY NINE-STORY BUILDING</a>
</h5>
</figcaption>
</figure>
<figure class="element">
<img class="element__image" src="http://ewigkeit.ucoz.club/codepen/poster-2.jpg" alt="picture" />
<figcaption class="element__figcaption">
<h5 class="element__figcaption__title">
<a href="#" class="element__link">ON THE 11TH FLOOR OF MY NINE-STORY BUILDING</a>
</h5>
</figcaption>
</figure>
<figure class="element">
<img class="element__image" src="http://ewigkeit.ucoz.club/codepen/poster-3.jpg" alt="picture" />
<figcaption class="element__figcaption">
<h5 class="element__figcaption__title">
<a href="#" class="element__link">ON THE 11TH FLOOR OF MY NINE-STORY BUILDING</a>
</h5>
</figcaption>
</figure>
<figure class="element">
<img class="element__image" src="http://ewigkeit.ucoz.club/codepen/poster-4.jpg" alt="picture" />
<figcaption class="element__figcaption">
<h5 class="element__figcaption__title">
<a href="#" class="element__link">ON THE 11TH FLOOR OF MY NINE-STORY BUILDING</a>
</h5>
</figcaption>
</figure>
<figure class="element">
<img class="element__image" src="http://ewigkeit.ucoz.club/codepen/poster-5.jpg" alt="picture" />
<figcaption class="element__figcaption">
<h5 class="element__figcaption__title">
<a href="#" class="element__link">ON THE 11TH FLOOR OF MY NINE-STORY BUILDING</a>
</h5>
</figcaption>
</figure>
</div>
* {
box-sizing: border-box;
}
body {
font-family: "Oswald", sans-serif;
background-color: #151414;
}
.cont {
width: 100%;
max-width: 1300px;
display: grid;
grid-gap: 20px;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
padding: 40px;
}
.element {
position: relative;
overflow: hidden;
width: 100%;
background: transparent;
height: 300px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
filter: drop-shadow(2px 4px 6px black);
border-radius: 10px;
}
.element::before {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
content: "";
background: rgba(2, 85, 236, 0.37);
transition: opacity 200ms ease;
z-index: 5;
opacity: 0;
}
.element::after {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
content: "";
background-color: rgba(0, 0, 0, 0.6);
z-index: 4;
}
.element:hover::before {
opacity: 1;
}
.element__image {
max-width: 100%;
backface-visibility: hidden;
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 500ms ease;
}
.element:hover .element__image {
transform: scale(1.1);
}
.element__figcaption {
position: absolute;
bottom: 20px;
left: 10px;
width: 100%;
z-index: 10;
padding: 10px 25px 10px 20px;
}
.element__link {
cursor: pointer;
color: inherit;
}
.element__figcaption__title {
font-size: 25px;
text-transform: uppercase;
color: #f1f1f1;
line-height: 1.4;
font-weight: 400;
transition: color 300ms ease;
}
.element__figcaption__title:hover {
color: #ffeb3b;
}
This Pen doesn't use any external JavaScript resources.