How do I save an SVG written in HTML as an SVG file? [closed] Ask Question

How do I save an SVG written in HTML as an SVG file? [closed] Ask Question

The following SVG code is written in an HTML file. But how do I save it as an SVG image?

<!-- code written in an HTML file -->
<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>

ベストアンサー1

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

おすすめ記事