Timeline for How can I make an SVG scale with its parent container?
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 2, 2023 at 10:03 | comment | added | podperson | Note that SVG uses actual camelCase attributes (that's not React!). It's like the svg folks just do not talk to anyone else. | |
Feb 27, 2023 at 21:55 | history | edited | isherwood | CC BY-SA 4.0 |
deleted 33 characters in body
|
Nov 13, 2022 at 19:09 | comment | added | boardkeystown | My friend you rule! Thank you. | |
May 7, 2022 at 12:53 | comment | added | Viktor Borítás |
@serge you add it to your html document as an <img> , <object> or <embed> tag with its src as the svg file. This way you lose the ability to modify it by CSS.. however you will remain able to modify its attributes with JavaScript. But if possible, better practice is to use svg inline.
|
|
Feb 18, 2021 at 18:04 | comment | added | serge | what if you just have an SGV file, not an svg inline object? | |
Sep 27, 2019 at 19:01 | comment | added | user48956 | Yes - you can always poke at the innards of various file formats with a programming - but you’d hope there’d be a method that works for all kinds of assets (e.g PNGs) and doesn’t require JavaScript programming. | |
Sep 27, 2019 at 18:06 | comment | added | Andrew | @user48956 You can always manipulate it after the fact with JavaScript. | |
Aug 30, 2019 at 19:13 | comment | added | user48956 | This doesn't seem to work for any SVG -- If you don't have control of the SVG source, then this method fails when the SVG has a fixed width. | |
Apr 23, 2018 at 22:52 | history | edited | agm1984 | CC BY-SA 3.0 |
fixed typo
|
Mar 29, 2018 at 20:48 | history | edited | agm1984 | CC BY-SA 3.0 |
added 94 characters in body
|
Mar 29, 2018 at 20:39 | history | edited | agm1984 | CC BY-SA 3.0 |
improved answer
|
Mar 29, 2018 at 18:55 | history | answered | agm1984 | CC BY-SA 3.0 |