<div class="wrapper">
<figure class="container">
<img src="https://assets.codepen.io/12005/bristol-harbor.jpg">
<img src="https://assets.codepen.io/12005/suspension-bridge.jpg">
<img src="https://assets.codepen.io/12005/tk-balloon1.jpg">
<figcaption class="caption">Bristol is a pretty nice place to live.</figcaption>
</figure>
</div>
:root {
--light-gray: hsla(300, 4%, 81%, 1);
--ghost-white: hsla(225, 100%, 99%, 1);
--davys-grey: hsla(12, 5%, 36%, 1);
--blue-sapphire: hsla(196, 67%, 33%, 1);
--charcoal: hsla(207, 38%, 25%, 1);
}
/* from https://coolors.co/d0ccd0-fbfcff-605856-1c6e8c-274156*/
img {
max-width: 100%;
display: block;
}
* {
box-sizing: border-box;
}
body {
background-color: var(--charcoal);
font: 1.2em/1.3 Roboto, sans-serif;
}
.wrapper {
box-sizing: border-box;
width: 960px;
height: 540px;
margin: 100px auto;
background-color: var(--ghost-white);
}
.container {
display: grid;
gap: 10px;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 1fr auto;
padding: 40px;
margin: 0;
list-style: none;
}
.container img {
aspect-ratio: 1/1;
grid-row: 1 / 3;
height: 100%;
width: 100%;
object-fit: cover;
}
.container :nth-child(1) {
grid-column: 1;
}
.container :nth-child(2) {
grid-column: 2;
}
.container :nth-child(3) {
grid-column: 3;
}
.container .caption {
padding: .3em;
background-color: rgba(0,0,0,.7);
color: white;
grid-column: 1 / -1;
grid-row: 2;
}
This Pen doesn't use any external JavaScript resources.