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
html5 svg没有显示_Html_Svg - Fatal编程技术网

html5 svg没有显示

html5 svg没有显示,html,svg,Html,Svg,我是html5 svg渲染新手。我试过这个: <svg width="200" height="200"> <symbol viewBox="0 0 64 64" id="shape-phone"> <title>phone</title> <g> <rect x="16" y="1" fill="none" stroke-width="2" stroke-mi

我是html5 svg渲染新手。我试过这个:

<svg width="200" height="200"> 
    <symbol viewBox="0 0 64 64" id="shape-phone">
        <title>phone</title> 
        <g> 
            <rect x="16" y="1" fill="none" stroke-width="2" stroke-miterlimit="10" width="32" height="62"/> 
            <line fill="none" stroke-width="2" stroke-miterlimit="10" x1="28" y1="5" x2="36" y2="5"/> 
            <line fill="none" stroke-width="2" stroke-miterlimit="10" x1="16" y1="51" x2="48" y2="51"/> 
            <line fill="none" stroke-width="2" stroke-miterlimit="10" x1="16" y1="9" x2="48" y2="9"/> 
            <circle fill="none" stroke-width="2" stroke-linejoin="bevel" stroke-miterlimit="10" cx="32" cy="57" r="2"/> 
        </g> 
    </symbol>
</svg>
您定义了一个
,但需要用
显示它:

<use xlink:href="#shape-phone" x="0" y="0" width="64" height="64" />
符号未显示,因为未设置
笔划

<svg width="200" height="200" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> 
  <symbol viewBox="0 0 64 64" id="shape-phone">
    <g> 
        <rect x="16" y="1" stroke="#00ff00" fill="none" stroke-width="2" stroke-miterlimit="10" width="32" height="62"/> 
        <line fill="none" stroke="#00ff00" stroke-width="2" stroke-miterlimit="10" x1="28" y1="5" x2="36" y2="5"/> 
        <line fill="none" stroke="#00ff00" stroke-width="2" stroke-miterlimit="10" x1="16" y1="51" x2="48" y2="51"/> 
        <line fill="none" stroke="#00ff00" stroke-width="2" stroke-miterlimit="10" x1="16" y1="9" x2="48" y2="9"/> 
        <circle fill="none" stroke="#00ff00" stroke-width="2" stroke-linejoin="bevel" stroke-miterlimit="10" cx="32" cy="57" r="2"/> 
    </g> 
  </symbol>
  <use xlink:href="#shape-phone" x="0" y="0" />
</svg>

您定义了一个
,但需要用
显示它:

<use xlink:href="#shape-phone" x="0" y="0" width="64" height="64" />
符号未显示,因为未设置
笔划

<svg width="200" height="200" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> 
  <symbol viewBox="0 0 64 64" id="shape-phone">
    <g> 
        <rect x="16" y="1" stroke="#00ff00" fill="none" stroke-width="2" stroke-miterlimit="10" width="32" height="62"/> 
        <line fill="none" stroke="#00ff00" stroke-width="2" stroke-miterlimit="10" x1="28" y1="5" x2="36" y2="5"/> 
        <line fill="none" stroke="#00ff00" stroke-width="2" stroke-miterlimit="10" x1="16" y1="51" x2="48" y2="51"/> 
        <line fill="none" stroke="#00ff00" stroke-width="2" stroke-miterlimit="10" x1="16" y1="9" x2="48" y2="9"/> 
        <circle fill="none" stroke="#00ff00" stroke-width="2" stroke-linejoin="bevel" stroke-miterlimit="10" cx="32" cy="57" r="2"/> 
    </g> 
  </symbol>
  <use xlink:href="#shape-phone" x="0" y="0" />
</svg>