Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I save svg code as a .svg image? [closed]

Tags:

svg

How could I save the following svg code as .svg image

<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">

<defs>
<linearGradient id="fill" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:rgb(224,224,224);stop-opacity:1"/>
<stop offset="100%" style="stop-color:rgb(153,153,153);stop-opacity:1"/>
</linearGradient>
</defs>

<path d="M 0 0 L 64 0 L 32 64 z" stroke="colourname" fill="url(#fill)"/>

</svg>

Any help would be appreciated. Thanks.

like image 486
necker Avatar asked Sep 27 '12 19:09

necker


People also ask

How do I get an SVG code for an image?

SVG images can be written directly into the HTML document using the <svg> </svg> tag. To do this, open the SVG image in VS code or your preferred IDE, copy the code, and paste it inside the <body> element in your HTML document. If you did everything correctly, your webpage should look exactly like the demo below.

How do I save an SVG as an image?

Navigate to an . svg file, right click on it and click on the context menu item 'Save SVG as PNG. Lets you click on the extension icon or right click on an . svg file and choose Save SVG as PNG.

Can you save an SVG file as a JPEG?

Go to File. Select Export. Click Export As. Select JPG format from the drop-down menu.


1 Answers

Just had to save it in a text file and give it a .svg extension.

like image 89
necker Avatar answered Oct 19 '22 03:10

necker