在代码中box-2,box-3行高自动拉伸到box-1行中最高项目的高度。box-2和列中有额外的间隙box-3。box-5我希望这个空白由第二行中的来填补。小提琴
.container {
display: grid;
grid-template-columns: 20% 40% 40%;
grid-gap: 20px;
}
.container > div {
border: 1px solid red;
}
.box-1 {
background-color: lightgreen;
height: 300px;
}
.box-2 {
background-color: lightsalmon;
height: 150px;
}
.box-3 {
background-color: lightsalmon;
height: 150px;
}
.box-4 {
background-color: lightskyblue;
height: 500px;
}
.box-5 {
background-color: lightseagreen;
grid-column: 2/-1;
}
<div class="container">
<div class="box-1"></div>
<div class="box-2"></div>
<div class="box-3"></div>
<div class="box-4"></div>
<div class="box-5"></div>
</div>
这是我正在寻找的输出

侃侃无极
不负相思意
aluckdog
随时随地看视频慕课网APP
相关分类