What you can do with each SVG insertion method (inline, object, background-image, and img)
As mentioned previously, SVGs differ from other graphical assets. They can behave differently, depending upon the way they are inserted into a page. As we have seen, there are four main ways in which to place SVG onto the page:
- Inside an
img
tag - Inside an
object
tag - As a background-image
- Inline
And depending upon the insertion method, certain capabilities will or will not be available to you. To understand what should be possible with each insertion method, it might be simpler to consider this table:
Figure 8.9: Depending upon the insertion method, differing capabilities are possible
Now, there are caveats to consider, marked within numbers:
- When using an SVG inside an object, you can use an external style sheet to style the SVG, but you have to link to that style sheet from within the SVG.
- You can use SVGs in an external...