baseline-shift property
Sets or retrieves a value that indicates how the dominant baseline should be repositioned relative to the dominant baseline of the parent text content element.
![]() ![]() |
Syntax
baseline-shift: baseline | sub | super |
<percentage>
|
<length>
Property values
baseline-
Default. There is no baseline shift; the dominant baseline remains in its original position.
sub-
The dominant baseline is shifted to the default position for subscripts. The offset to this position is determined by using the font data for the nominal font.
super-
The dominant baseline is shifted to the default position for superscripts. The offset to this position is determined by using the font data for the nominal font.
- percentage
-
The computed value of the property is this percentage multiplied by the computed
line-heightof the text element. The dominant baseline is shifted in the shift-direction (positive value) or opposite to the shift-direction (negative value) of the parent text by the computed value. A value of0%is equivalent to baseline. - length
-
The dominant baseline is shifted in the shift-direction (positive value) or opposite to the shift-direction (negative value) of the parent text content element by the
lengthvalue. A value of0cmis equivalent to baseline.
CSS information
| Applies To | ‘tspan’, ‘tref’, ‘altGlyph’, ‘textPath’ elements |
|---|---|
| Media | visual |
| Inherited | no |
| Initial Value | baseline |
Standards information
- Scalable Vector Graphics: Text, Section 10.9.2
Remarks
As of Microsoft Edge, this presentation attribute is animatable with CSS Animations and CSS Transitions.
The baseline-shift property allows repositioning of the dominant baseline relative to the dominant baseline of the parent text content element. The shifted object might be a subscript or superscript. Within the shifted object, the whole baseline table is offset; not just a single baseline. The amount of the shift is determined by one of the following:
- the parent text content element
- the subscript or superscript offset from the nominal font of the parent text content element
- the percent of the
line-heightof the parent text content element - an absolute value.
See also

