[ACCEPTED]-Opening a SVG in a browser renders XML code instead of image-svg
Accepted answer
As for your last question: How do browsers 7 determine whether to show an image or XML 6 code?
The answer lies in XML namespace. The 5 XML namespace specified in an XML tag tells 4 the user agent how to handle the tags. So 3 if you have an <svg>
without attribute xmlns="http://www.w3.org/2000/svg"
then 2 the browser will show text not the SVG rendered 1 vector graphics.
You have to configure your server to send 2 you svg files with Content-Type: image/svg+xml
header. Here is an example 1 on how to do this with Apache.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.