Simple svg image

by Naveenkumar 2013-01-24 15:11:36

Simple svg image

Copy & paste the below code to new file and save the file as .svg extension. (eg: rect.svg)

<svg>
<rect x="10" y="10" width="200" height="100" stroke="blue" fill="#CCC"/>
</svg>


We can't set svg images as image source in html.

So we can use embed or object tag for displaying svg images like
<object data="rect.svg" type="svg+xml"></object>


To view the svg image from your localhost you can specify the following code in your .htaccess file
AddType image/svg+xml svg


<object data="image.php?id=6961" type="svg+xml"></object>

Tagged in:

980
like
0
dislike
0
mail
flag

You must LOGIN to add comments