Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

dy

« SVG Attribute reference home

The dy attribute indicates a shift along the y-axis on the position of an element or its content. What exactly is shifted depends on the element for which this attribute is set.

For the <feOffset> element, it's a <number> that represents the amount to offset the input graphic. This amount is expressed in the coordinate system established by the primitiveUnits attribute on the <filter> element.

For the <glyphRef> element, it's a <number> that represents the relative Y coordinate within the font's coordinate system for this glyph.

For <text>, <tspan>, <tref>, and <altGlyph> elements, things are a little more complex because they accept a <list-of-length>:

If a single <length> is provided, this value represents the new relative Y coordinate for the current text position for the first character within this element or any of its descendents. The current text position is shifted along the y-axis of the current user coordinate system by <length> before the first character is rendered.

If a comma- or space-separated list of n <length>s is provided, then the values represent incremental shifts along the y-axis for the current text position of the first n characters within this element or any of its descendents. Thus the current text position resulting from drawing the character within the current <text> element is shifted along the Y axis of the current user coordinate system by <length>.

If more characters exist than <length>s, then for each of these extra characters:

  • if an ancestor <text> or <tspan> element specifies a relative Y coordinate for the given character via a dy attribute, then the current text position is shifted along the y-axis of the current user coordinate system by that amount (nearest ancestor has precedence),
  • else no extra shift along the y-axis occurs.

Usage context

Categories None
Value <number> | <list-of-length>
Animatable Yes
Normative document SVG 1.1 (2nd Edition): altGlyph element
SVG 1.1 (2nd Edition): feOffset element
SVG 1.1 (2nd Edition): glyphRef element
SVG 1.1 (2nd Edition): text element
SVG 1.1 (2nd Edition): tspan element

Elements

The following elements can use the x attribute

Document Tags and Contributors

 Contributors to this page: LachlanArthur, kscarfone, Jeremie
 Last updated by: LachlanArthur,