Leyth Leyth - 4 months ago 12
HTML Question

Stacking images with 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?

enter image description here



<div class="container">
<img class="image1" src="#" alt="null">
<img class="image1" src="#" alt="null">
<img class="image3" src="#" alt="null">
</div>




Answer

I would do this like this:

.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>