在Microsoft Edge中使用svg tag tref

时间:2016-12-06 20:53:09

标签: html svg

我尝试了以下方式使用W3C SVG规范1.1中的svg标记tref的示例

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
<svg width="10cm" height="3cm" viewBox="0 0 1000 300" 
    version="1.1" 
    xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink">

    <defs> 
        <text id="ReferencedText"> 
            Referenced character data 
        </text> 
    </defs>

    <desc>Example tref01 - inline vs reference text content</desc>

    <text x="100" y="100" font-size="45" fill="blue"> 
        Inline character data 
    </text>

    <text x="100" y="200" font-size="45" fill="red"> 
        <tref xlink:href="#ReferencedText" /> 
    </text>

    <!-- Show outline of canvas using 'rect' element -->
    <rect x="1" y="1" width="998" height="298" 
          fill="none" stroke="blue" stroke-width="2" />

</svg>
</body>
</html>

使用Microsoft Edge。但是没有输出引用的文本。 MS Edge是否支持此标记?

1 个答案:

答案 0 :(得分:3)

<tref>已被弃用,大多数浏览器都不支持。

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tref

相关问题