According to this site you have several options. . although I personally struggle with this ...
"A simple and easy way to include SVG in a web page is to use the XHTML object tag. Here is an example:"
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SVG Included with <object> tag in an XHTML File</title> </head> <body> <h1>An SVG rectangle (via <object> tag)</h1> <object type="image/svg+xml" data="web_square.svg"> Browser does not support SVG files! </object> </body> </html>
"Include SVG file." image / svg + xml "is the MIME type of the included file. It must be specified." "The text to be displayed if the browser does not support SVG. Browsers should ignore tags that they do not understand, thereby exposing the text."
It also describes the method of using namespaces ....
βAn SVG file can be placed directly into an XHTML file through namespaces. Here is an example of a very simple XHTML file that displays a blue square. The square was drawn using Inkscape (for clarity, the Inkscape image was saved as a regular SVG file, and some of the unused rectangle attributes have been deleted.) "
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SVG Embedded into an XHTML File</title> </head> <body> <h1>An SVG rectangle (via Name spaces)</h1> <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" width="150" height="150" id="svg1341"> <defs id="defs1343" /> <g id="layer1"> <rect width="90" height="90" x="30" y="30" style="fill:#0000ff; fill-opacity:0.75; stroke:#000000 stroke-width:1px" id="rect1353" /> </g> </svg> </body> </html>
Good luck .. SVG is not easy ..
Alex gray
source share