16 Images Flashcards

1
Q

What are 3 ways of getting an SVG into your page and the adv, disadv of each?

A

Just dump it on the page with &ltimg>
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly