<tref>

非推奨;: この機能は非推奨になりました。まだ対応しているブラウザーがあるかもしれませんが、すでに関連するウェブ標準から削除されているか、削除の手続き中であるか、互換性のためだけに残されている可能性があります。使用を避け、できれば既存のコードは更新してください。このページの下部にある互換性一覧表を見て判断してください。この機能は突然動作しなくなる可能性があることに注意してください。

SVG の <text> 要素のテキストコンテンツは、 <text> 要素内に直接埋め込まれた文字データ、または参照先が <tref> 要素で指定された要素の文字データコンテンツのどちらかになります。

使用コンテキスト

カテゴリーテキストコンテンツ要素、テキストコンテンツの子要素
許可されている内容任意の数、任意の順序の以下の要素。
説明的要素
<animate><set>

属性

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>

仕様書

Specification
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
# TRefElement

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
tref
Deprecated
fill
Deprecated
context-fill value
Deprecated
systemLanguage
Deprecated
xlink:href
Deprecated

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Deprecated. Not for use in new websites.

関連情報