Path: blob/main/files/en-us/web/svg/attribute/dy/index.md
6566 views
------{{SVGRef}}
The dy attribute indicates a shift along the y-axis on the position of an element or its content.
You can use this attribute with the following SVG elements:
{{SVGElement('altGlyph')}}
{{SVGElement('feDropShadow')}}
{{SVGElement('feOffset')}}
{{SVGElement('glyphRef')}}
{{SVGElement('text')}}
{{SVGElement('tref')}}
{{SVGElement('tspan')}}
Example
{{EmbedLiveSample("Example", '100%', 200)}}
altGlyph
Warning: As of SVG2 {{SVGElement('altGlyph')}} is deprecated and shouldn't be used.
For {{SVGElement('altGlyph')}}, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph.
If there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. If there are less values than glyphs, the remaining glyphs use a value of 0. If there are more values than glyphs, extra values are ignored.
| Value | List of <length> |
|---|---|
| Default value | none |
| Animatable | Yes |
feDropShadow
For {{SVGElement('feDropShadow')}}, dy defines the y offset of the dropped shadow. The unit used to resolve the value of the attribute is set by the {{SVGAttr('primitiveUnits')}} attribute of the {{SVGElement('filter')}} element.
| Value | <number> |
|---|---|
| Default value | 2 |
| Animatable | Yes |
feOffset
For {{SVGElement('feOffset')}}, dy defines the y offset of the filter input graphic. The unit used to resolve the value of the attribute is set by the {{SVGAttr('primitiveUnits')}} attribute of the {{SVGElement('filter')}} element.
| Value | <number> |
|---|---|
| Default value | 0 |
| Animatable | Yes |
glyphRef
Warning: As of SVG2 {{SVGElement('glyphRef')}} is deprecated and shouldn't be used.
For {{SVGElement('glyphRef')}}, dy defines the y offset of the glyph, in the font metric system.
| Value | <number> |
|---|---|
| Default value | 0 |
| Animatable | Yes |
text
For {{SVGElement('text')}}, if it contains a single value, dy defines a shift along the y-axis for all glyphs.
If there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. If there are less values than glyphs, the remaining glyphs use a value of 0. If there are more values than glyphs, extra values are ignored.
| Value | List of <length> |
|---|---|
| Default value | none |
| Animatable | Yes |
Example
{{EmbedLiveSample('text', '100%', 100)}}
tref
Warning: As of SVG2 {{SVGElement('tref')}} is deprecated and shouldn't be used.
For {{SVGElement('tref')}}, if it contains a single value, dy defines a shift along the y-axis for all glyphs.
If there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. If there are less values than glyphs, the remaining glyphs use a value of 0. If there are more values than glyphs, extra values are ignored.
| Value | List of <length> |
|---|---|
| Default value | none |
| Animatable | Yes |
tspan
For {{SVGElement('tspan')}}, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph.
If there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. If there are less values than glyphs, the remaining glyphs use a value of 0. If there are more values than glyphs, extra values are ignored.
| Value | List of <length> |
|---|---|
| Default value | none |
| Animatable | Yes |
Specifications
{{Specifications}}