<tref>
已棄用:此功能不再推薦。雖然一些瀏覽器可能仍然支援它,但它可能已經從相關網路標準中刪除,可能正在被刪除,或者可能只是為了相容性而保留。避免使用它,如果可能,請更新現有程式碼;請參閱此頁面底部的相容性表格,以指導您的決定。請注意,此功能可能隨時停止工作。
用於 <text> SVG 元素的文字內容可以是直接嵌入在 <text> 元素中的字元資料,也可以是引用元素的字元資料內容,其中引用由 <tref> 元素指定。
使用場景
屬性
xlink:href已棄用
DOM 介面
此元素實現 SVGTRefElement 介面。
示例
xml
<svg width="100%" height="100%" viewBox="0 0 1000 300"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<text id="ReferencedText">
Referenced character data
</text>
</defs>
<text x="100" y="100" font-size="45" >
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-width="2" />
</svg>
規範
| 規範 |
|---|
| 可縮放向量圖形 (SVG) 1.1 (第二版) # TRefElement |
瀏覽器相容性
BCD 表格僅在瀏覽器中載入