<main>
<header>
<h1>
Portraits of
<br />
American women
</h1>
<h2>Dorothea Lange</h2>
</header>
<section></section>
<figure>
<img src="https://picsum.photos/800/800?random=1" alt="">
</figure>
<figure>
<img src="https://picsum.photos/800/800?random=2" alt="">
</figure>
<figure>
<img src="https://picsum.photos/800/800?random=3" alt="">
</figure>
<figure>
<img src="https://picsum.photos/800/800?random=4" alt="">
</figure>
</main>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
figure {
margin: 0;
}
body {
width: 100vw;
min-height: 100vh;
font-family: "Exo", Arial, sans-serif;
background-color: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
}
main {
display: grid;
grid-template-columns: 2fr 1fr 1fr 2fr;
grid-template-rows: 2fr 1fr 1fr 2fr;
max-width: 80vmin;
min-width: 600px;
}
header,
section {
grid-row: 2 / 4;
padding: 2rem;
grid-column: 2 / 4;
text-align: center;
align-self: center;
z-index: 2;
}
header h1 {
margin: 0;
font-size: 18px;
}
header h2 {
font-size: 12px;
margin-top: 0.5rem;
}
section {
background-color: #fff;
z-index: 1;
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
aspect-ratio: 1 / 1;
}
figure:nth-of-type(1) {
grid-row: 1 / 3;
grid-column: 1 / 3;
align-self: end;
}
figure:nth-of-type(2) {
grid-row: 1 / 3;
grid-column: 3 / 5;
align-self: end;
}
figure:nth-of-type(3) {
grid-row: 3 / 5;
grid-column: 1 / 3;
}
figure:nth-of-type(4) {
grid-row: 3 / 5;
grid-column: 3 / 5;
}
figure img {
max-width: 100%;
height: auto;
object-fit: cover;
object-position: center;
vertical-align: top;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.