你知道什么是孤独嘛?就像你一言不发的离开,我在漫无边际的回忆和冷风里一边恨你,一边等你。
HTML结构:
<div class="box">
<div class="top-left">
<img src="./assets/img/grid.jpg" alt="" width="100%">
</div>
<div class="top-right-item1"></div>
<div class="top-right-item2"></div>
<div class="top-right-item3"></div>
<div class="bottom"></div>
</div>
CSS样式:
img {
vertical-align: bottom;
}
.box {
width: 100%;
max-width: 620px;
margin: 0 auto;
display: grid;
grid-template-columns: 1fr 10px 1fr;
grid-template-rows: repeat(3, 1fr 10px) 2fr;
}
.top-left {
grid-row: 1 / 6;
overflow: hidden;
}
.top-right-item1 {
grid-row: 1 / 2;
grid-column: 3 / 4;
background: url(../img/grid.jpg) no-repeat center center / cover;
}
.top-right-item2 {
grid-row: 3 / 4;
grid-column: 3 / 4;
background: url(../img/grid.jpg) no-repeat center center / cover;
}
.top-right-item3 {
grid-row: 5 / 6;
grid-column: 3 / 4;
background: url(../img/grid.jpg) no-repeat center center / cover;
}
.bottom {
grid-row: 7 / 8;
grid-column: 1 / 4;
overflow: hidden;
background: url(../img/grid.jpg) no-repeat center center / cover;
}
PS:为了实现屏幕自适应所以我使用的是 一个img标签 + N个背景图的方式来实现的。