Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将svg代码保存为.svg图像?_Svg - Fatal编程技术网

如何将svg代码保存为.svg图像?

如何将svg代码保存为.svg图像?,svg,Svg,如何将以下svg代码保存为.svg图像 <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-

如何将以下svg代码保存为.svg图像

<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>


任何帮助都将不胜感激。谢谢。

只需将其保存在一个文本文件中,并给它一个.svg扩展名。

只需将其放在一个文件中,您会看到什么问题?如果我将其放在一个文件中,这没问题,但我想将其用作边框图像属性,如:img.frame{-moz border image:url('frame.svg')93 92;}那么它必须以某种方式保存吗?或者它只是单向的,即从图像到svn html?我明白了,你指的是文本文件而不是html文档。缺点有助于:)复习答案。这与CSS3有什么关系?SVG与CSS没有直接关系。在Office365中粘贴SVG标记@Kiarash之前,请确保在SVG文件的顶部添加xml标记a。添加xml标记会使SVG无法识别。对我来说,xml标记不是必需的,但我必须删除任何
别忘了:xmlns=”“对我来说,关键是添加
xmlns=”http://www.w3.org/2000/svg"
(别忘了不要包括
http://www.
part-当我复制并粘贴@GBrian)中的值时,我被绊倒了。