flex-grow - Maintain aspect ratio
Suppose i have the following:
How can i ensure that not only the width of the children grows, but also the height grows so that the aspect ratio is maintained?
8 Replies
use grid xD
Yea I mean I know being told to use a different tool is a bit crass but
use the right tools for the right job
yeah i just have less experience with grid, which is why i tried it with flexbox 😄
unless you wanted the flex wrap with different alignment grid would probably work best.
update with a auto fit template
basic example I had already but hope it helps
thank you, i will look into it
if you didn't want them to grow at all you can replace
auto-fit
with auto-fill
ok the issue was that i had a fixed width/height. This prevents them from growing on w/h in both flex and grid.
plus: i have to use the
aspect-ratio
prop