使用CSS Flexbox堆叠图像 [英] Stacking images with CSS Flexbox
本文介绍了使用CSS Flexbox堆叠图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在学习使用CSS
flexbox,我想在左侧渲染一个大图像,并在彼此顶部叠加两个小图像.如何使用CSS
flexbox做到这一点?
I am learning to use CSS
flexbox and I would like to render a big image on the left and two small images stacked on top of each other. How can I do this using CSS
flexbox?
<div class="container">
<img class="image1" src="#" alt="null">
<img class="image1" src="#" alt="null">
<img class="image3" src="#" alt="null">
</div>
推荐答案
我会这样:
.container {
display: flex;
}
.side {
display: flex;
flex-direction: column;
}
.image {
display: block;
margin: 5px;
}
<div class="container">
<img class="image" src="http://placehold.it/250x250" alt="null">
<div class="side">
<img class="image" src="http://placehold.it/120x90" alt="null">
<img class="image" src="http://placehold.it/120x150" alt="null">
</div>
</div>
这篇关于使用CSS Flexbox堆叠图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文