Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stacking images with CSS Flexbox

Tags:

html

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>
like image 365
Abulurd Avatar asked Jul 02 '26 00:07

Abulurd


1 Answers

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>
like image 115
Green Avatar answered Jul 04 '26 17:07

Green



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!