-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
62 lines (47 loc) · 1.73 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
title: baseline-shift
slug: Web/SVG/Attribute/baseline-shift
page-type: svg-attribute
browser-compat: svg.global_attributes.baseline-shift
---
{{SVGRef}}
The **`baseline-shift`** attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. The shifted object might be a sub- or superscript.
> [!NOTE]
> As a presentation attribute `baseline-shift` can be used as a CSS property.
> [!NOTE]
> This property is going to be deprecated and authors are advised to use [`vertical-align`](/en-US/docs/Web/CSS/vertical-align) instead.
You can use this attribute with the following SVG elements:
- {{SVGElement("textPath")}}
- {{SVGElement("tref")}}
- {{SVGElement("tspan")}}
## Usage notes
<table class="properties">
<tbody>
<tr>
<th scope="row">Value</th>
<td>
{{cssxref("length-percentage")}} | <code>sub</code> |
<code>super</code>
</td>
</tr>
<tr>
<th scope="row">Default value</th>
<td><code>0</code></td>
</tr>
<tr>
<th scope="row">Animatable</th>
<td>Yes</td>
</tr>
</tbody>
</table>
- `sub`
- : The dominant-baseline is shifted to the default position for subscripts.
- `super`
- : The dominant-baseline is shifted to the default position for superscripts.
- `<length-percentage>`
- : A length value raises (positive value) or lowers (negative value) the dominant-baseline of the parent text content element by the specified length.
A percentage value raises (positive value) or lowers (negative value) the dominant-baseline of the parent text content element by the specified percentage of the {{SVGAttr("line-height")}}.
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}