dy

dy 属性は、要素やそのコンテンツの位置の y 軸方向のオフセットを示します。

この属性は以下の SVG 要素で使用することができます。

html
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Lines materialized the position of the glyphs -->
  <line x1="10%" x2="10%" y1="0" y2="100%" />
  <line x1="0" x2="100%" y1="30%" y2="30%" />
  <line x1="0" x2="100%" y1="80%" y2="80%" />

  <!-- Some reference text -->
  <text x="10%" y="30%" fill="grey">SVG</text>

  <!-- The same text with a shift along the y-axis -->
  <text dy="50%" x="10%" y="30%">SVG</text>
</svg>
css
line {
  stroke: red;
  stroke-width: 0.5px;
  stroke-dasharray: 3px;
}

feDropShadow

<feDropShadow> の場合、dy はドロップシャドウの y オフセットを定義します。属性の値を解決するために使用する単位は、 <filter> 要素の primitiveUnits (en-US) 属性で設定します。

<number>
既定値 2
アニメーション

feOffset

<feOffset> の場合、dy はフィルター入力グラフィックの y オフセットを定義します。属性の値を解決するために使用する単位は、 <filter> 要素の primitiveUnits (en-US) 属性で設定します。

<number>
既定値 0
アニメーション

glyphRef

警告: SVG2 において、 <glyphRef> (en-US) は非推奨であり、使用しないでください。

<glyphRef> (en-US) の場合、 dy はグリフの y オフセットを定義します。

<number>
既定値 0
アニメーション

text

<text> の場合、それが単一の値を格納していれば、 dy はすべてのグリフに対して y 軸方向のシフト量を定義します。

複数の値がある場合、dy は個々のグリフに対して、直前のグリフとの相対的な y 軸方向のシフト量を定義します。値の数がグリフの数よりも少ない場合、残りのグリフは 0 の値を使用します。値の数がグリフの数よりも多い場合は、余分な値は無視されます。

<length> のリスト
既定値 none
アニメーション

html
<svg viewBox="0 0 150 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Horizontal lines -->
  <line x1="0" x2="100%" y1="30" y2="30" />
  <line x1="0" x2="100%" y1="40" y2="40" />
  <line x1="0" x2="100%" y1="50" y2="50" />
  <line x1="0" x2="100%" y1="60" y2="60" />

  <!-- Vertical lines -->
  <line x1="10" x2="10" y1="0" y2="100%" />
  <line x1="50" x2="50" y1="0" y2="100%" />
  <line x1="90" x2="90" y1="0" y2="100%" />

  <!-- Behaviors change based on the number of values in the attributes -->
  <text dy="20" x="10" y="30">SVG</text>
  <text dy="0 10" x="50" y="30">SVG</text>
  <text dy="0 10 20" x="90" y="30">SVG</text>
</svg>
css
line {
  stroke: red;
  stroke-width: 0.5px;
  stroke-dasharray: 3px;
}

tref

警告: SVG2 において、 <tref> (en-US) は非推奨であり、使用しないでください。

<tref> (en-US) では、 1 つの値を格納している場合、 dy はすべてのグリフに対する y 軸方向のシフト量を定義します。

複数の値がある場合、dy は個々のグリフに対して、直前のグリフとの相対的な y 軸方向のシフト量を定義します。値の数がグリフの数よりも少ない場合、残りのグリフは 0 の値を使用します。値の数がグリフの数よりも多い場合は、余分な値は無視されます。

List of <length>
既定値 none
アニメーション

tspan

<tspan> の場合、それが 1 つの値を格納する場合、 dy はすべての代替グリフに対して y 軸に沿ったシフト量を定義します。

複数の値がある場合、dy は個々のグリフに対して、直前のグリフとの相対的な y 軸方向のシフト量を定義します。値の数がグリフの数よりも少ない場合、残りのグリフは 0 の値を使用します。値の数がグリフの数よりも多い場合は、余分な値は無視されます。

<length> のリスト
既定値 none
アニメーション

仕様書

Specification
Filter Effects Module Level 1
# element-attrdef-fedropshadow-dy
Filter Effects Module Level 1
# element-attrdef-feoffset-dy
Scalable Vector Graphics (SVG) 2
# TextElementDYAttribute