Dude like you said that you do not know display:grid
I will suggest you this complete guide will help you in other cases.
Now look at this image, notice the grid lines I've split them using repeat(nomero de repetiçoes, tamanho da célula)
in the case 8 cells of equal size repeat(8, 1fr)
, to make the size of the cells I used span n / n, you can read about it here tb: link and to give the spacing between one image and another just set the grid-gap
(I commented on css)
Seethenaturalresponsivenessofgrid
AboutadjustingtheimagesinsidethecellIusedobject-fit
Youcanreadmoreaboutthisinthisquestion:#
Here is the code for the image above:
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
.container {
height: 200px;
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-template-rows: repeat(2, 100px);
grid-gap: 1rem; /* espaço entre as imagens */
box-sizing: border-box;
}
.i1 {
grid-column: 1 / 3;
grid-row: 1 / 3;
}
.i2 {
grid-column: 3 / 4;
grid-row: 1 / 2;
}
.i3 {
grid-column: 4 / 7;
grid-row: 1 / 2;
}
.i4 {
grid-column: 7 / 9;
grid-row: 1 / 3;
}
.i5 {
grid-column: 3 / 6;
grid-row: 2 / 3;
}
.i6 {
grid-column: 6 / 7;
grid-row: 2 / 3;
}
section {
box-sizing: border-box;
border: 1px solid;
}
section > img {
object-fit: cover;
width: 100%;
height: 100%;
}
<div class="container">
<section class="i1">
<img src="https://placecage.com/100/100"alt="">
</section>
<section class="i2">
<img src="https://placecage.com/100/100"alt="">
</section>
<section class="i3">
<img src="https://placecage.com/100/100"alt="">
</section>
<section class="i4">
<img src="https://placecage.com/100/100"alt="">
</section>
<section class="i5">
<img src="https://placecage.com/100/100"alt="">
</section>
<section class="i6">
<img src="https://placecage.com/100/100"alt="">
</section>
</div>