Several times I have opened SVG files located on various sites through a browser, and they were displayed as images.
Now, I copy this same SVG, I upload it to a remote host, and both Google Chrome and Firefox render XML code.
How do browsers determine whether to show an image or XML code?
As for your last question: How do browsers determine whether to show an image or XML code?
The answer lies in XML namespace. The XML namespace specified in an XML tag tells the user agent how to handle the tags. So if you have an <svg>
without attribute xmlns="http://www.w3.org/2000/svg"
then the browser will show text not the SVG rendered vector graphics.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With