16 Images Flashcards
What are 3 ways of getting an SVG into your page and the adv, disadv of each?
Just dump it on the page with <img>
OR
link it in your CSS using background-image: url(./my-image.svg)
BUT
It will read as a vector butthe contents of the SVG will not be accessible from the webpage
pasting their contents directly into your webpage’s code, rather than linking to it as an image. It will still render correctly, but the SVG’s properties will be visible to your code, which will allow you to alter the image dynamically via CSS or JavaScript.
BUT
it makes your code harder to read, makes your page less cacheable, and if it’s a large SVG it might delay the rest of your HTML from loading.