issues with svg being resized based on their parent flexbox
i have an issue here, big svgs in width that i fetch from a source
i have a list of svgs, that are 100vw long, they're 6 of them & i want to use them in a flex container & to resize based on the container if i substracted or added a new element here's the blade file
the images won't resize based on the flex
12 Replies
see the scrollbar it goes on
I'd take them out of <img> and use them proper <svg>
also you should really never use spaces in your folder names. Especially if they are going to be paths.
uhh that means to copy paste all that content of the svg back into the html, can't do it
also it doesn't have the src property as img
use a SVG sprite and <use>
make a dynamic component and brrrrrrrrrrr
Also use grid to fill, flex to condense
just a tip 😄
what about that??
Gird will make its children want to fill rather than be dense (max-content) by default
Either works just find Grid is easier to mess with if you want things to fill
less effort/code
how to make this in a grid
Depends how you want it to be responsive. Can share the code in a minimal so we don't have to go back in forth. You said you wanted the svg to fill so I was just making the comment.
ohh no no this on another thing
oh please make a new post if its a different help question please. But same applies, depends on how you want to handle the "squish" or responsiveness.
!closed
If it's a site built using Vite, you can add the
?raw
suffix, like import Image from '$assets/image.svg?raw
, and you can insert it into the page without having to edit it.