Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SVG Question

Status
Not open for further replies.

IndyGill

Technical User
Jan 15, 2001
191
GB
Hi

I have just discovered SVG graphics and like the functionality of it. However I would like to incorporate this in this in a web page I am building. However the entire page cannot be .svg, it needs to sit in a html page.

So for example I have a page called test.svg with the following code.

<?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?>
<svg width=&quot;800&quot; height=&quot;300&quot;>
<circle cx=&quot;20&quot; cy=&quot;50&quot; r=&quot;20&quot; x=&quot;50&quot; y=&quot;50&quot; style=&quot;fill:red&quot; />
</svg>

I need to set in a .html page, im not sure how to do this or it possible. Also I would be grateful for any bodies views on SVG.... how compatible is it, and would you recommend using it in a site.

Many thanks in advance

Indy

PS By the way I cant use flash to do the functionality as my audience does not have a flash player installed
 
Using the <embed> tag seems to work ok:

<body>
<embed src=&quot;myfile.svg&quot; width=&quot;x&quot; height=&quot;y&quot; />
</body>

There are lots of attributes you can set, but this should get you going.

It's hard to say whether or not I would recommend using SVG. I'd like to see it get the support it deserves, because it does offer some important advantages. I think Flash took the world by storm, and people aren't paying enough attention to the alternatives, such as SVG. The fact that it's XML based and doesn't require anything more than notepad to produce certainly make it noteworthy imho.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top