Answer the question
In order to leave comments, you need to log in
How to embed svg image in html page?
Hello!
Please do not immediately send to Google) The
question is:
What is the best way to embed an svg image into an html page at the moment?
That is, to make it cross-browser friendly and more optimized?
I found old articles, but I doubt that standards have not changed in a couple of years)
Answer the question
In order to leave comments, you need to log in
palmistry.hol.es -
Optimization measures after copying from a file made in the "incskape" editor and saved as hand.svg
- pasted all the code copied from the SVG file onto the page
- cleaned up some garbage that remains after the editor
- signed the elements with his classes
- as far as he could - he took out the styles in the CSS file in order to free up even more space
SVG is ready to go. There are selectors that can be used to manipulate through jQuery just like any other tags on the page.
This is without discussing the server side. Quite enough to work comfortably.
Crossbrowser - no way. My sites are still visited with IE6 but not more than 1%. Full SVG support since 9ki. And there are a lot of users from 8 (over 5%). In general, the issue is relevant and requires crutches. I used to do with svgweb .
Embed is possible.
I think object too.
Some people seem to understand img.
And also there is an inline svg.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question