<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
text-align: center;
}
div {
display: grid;
grid-template-rows: 150px 150px 150px;
grid-template-columns: 150px 150px 150px;
}
p {
display: flex;
align-items: center;
justify-content: center;
}
p:nth-child(1) {
background-color: red;
grid-area: 1/1/2/3;
}
p:nth-child(2) {
grid-area: 1/3/3/4;
background-color: orange;
}
p:nth-child(3) {
grid-area: 3/2/4/4;
background-color: yellow;
}
p:nth-child(4) {
grid-area: 2/1/4/2;
background-color: green;
}
p:nth-child(5) {
background-color: cyan;
grid-area: 2/2/3/3;
}
</style>
</head>
<body>
<div>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
</div>
</body>
</html>
