- select the number of images that will fit in the row at a normal height
- grow the height of the images in the row until the row is full width.
Код: Выделить всё
.root{
display:flex;
flex-direction: row;
flex-wrap: wrap;
width: 500px;
border:2px solid black;
& div{
border: 1px solid blue;
height: 100px;
}
& .portrait{
aspect-ratio: 3 / 2;
}
& .landscape{
aspect-ratio: 2 / 3;
}
}
.desired{
& div:nth-of-type(1), div:nth-of-type(2), div:nth-of-type(3){
height: 134px;
}
& div:nth-of-type(4), div:nth-of-type(5), div:nth-of-type(6){
height: 109px;
}
}
< /code>
Current:
s
w
s
s
s
s
w
Desired:
s
w
s
s
s
s
w
Подробнее здесь: https://stackoverflow.com/questions/795 ... ratio-by-a