这就是我想要实现的设计:链接。
我尝试制作两个单独的 Div,并将一个放置在另一个 Div 之上,但它不起作用。
老实说,我想过将图像作为主 Div 的背景,但这会带来新的问题。但如果这是正确的方法,我会这样做。
老实说,我不知道如何找到解决这个问题的方法。
<div class="parent">
<div class="above">
<div>Square1</div>
<div>Square2</div>
<div>Square3</div>
</div>
<div class="under"><img src="....."></div>
</div>
.parent {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 750px;
background-color: white;
}
.under {
overflow: hidden;
display: flex;
align-items: right;
justify-content: right;
}
.under img {
width: 100%;
height: auto;
align-self: right;
}
.above {
position: absolute;
}