Hello everyone, typically I'm quite skilled when it comes to CSS but this particular challenge has pushed me to my limits.
I have a desire to create a grid where all elements maintain the same aspect ratio (with images that already share this aspect ratio) and have padding or margin between them.
It may sound simple, but what I envision is something like this: https://i.sstatic.net/aROjJ.png
To break it down:
- The first picture should be twice as big as the second
- All pictures need to maintain the same aspect ratio
- There should be a 30px distance between the pictures
- On mobile devices, they should stack on top of each other with each taking up 100% width - which I've managed without issue
I've come close to achieving the desired look, but haven't quite hit the mark.
In addition, this layout needs to be responsive across various screen sizes, adjusting based on the screen or container width.
I attempted using flex and flex-grid, however, my efforts were unsuccessful.
Has anyone successfully accomplished this and can offer guidance on how to solve this? Thank you!