我想在角落的4段和div的中心1我该怎么办?
我希望我理解你的权利。我提供了一个有关的例子:
<!DOCTYPE html>
<html>
<head>
<style>
.container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr;
grid-template-areas:
'first . second'
'. third . '
'fourth . fifth';
width: 500px;
height: 500px;
border: 1px solid red;
}
.container > p {
display: flex;
justify-content: center;
align-items: center;
border: 1px solid black;
}
.first {
grid-area: first;
}
.second {
grid-area: second;
}
.third {
grid-area: third;
}
.fourth {
grid-area: fourth;
}
.fifth {
grid-area: fifth;
}
</style>
</head>
<body>
<div class="container">
<p class="first">1</p>
<p class="second">2</p>
<p class="third">3</p>
<p class="fourth">4</p>
<p class="fifth">5</p>
</div>
</body>
</html>