CSS baseline-shift Property
CSS PropertyThis property is supported by all modern browsers.
Description
The baseline-shift property moves text up or down relative to the dominant baseline of its parent, for example to create superscripts and subscripts in SVG text. Positive values raise the text and negative values lower it. It applies to SVG text content such as <tspan> and <textPath>, and in CSS Inline Layout to inline boxes as well, where it is one of the longhands of vertical-align.
The keywords sub and super use the font's recommended subscript and superscript offsets. Percentages refer to the line-height of the element.
Definition
- Initial value
- 0
- Applies to
- inline-level boxes and SVG text content elements
- Inherited
- no
- Computed value
- the specified keyword or an absolute length
- Animatable
- by computed value type
- JavaScript syntax
- object.style.baselineShift
Interactive Demo
Syntax
baseline-shift: <length-percentage> | sub | super | top | center | bottom;
Values
- <length>Raises (positive) or lowers (negative) the element by the given length.
- <percentage>Raises or lowers the element by a percentage of its line-height.
- subLowers the baseline to the font's subscript position.
- superRaises the baseline to the font's superscript position.
- top, center, bottomAligns the element relative to the line box (CSS Inline Layout values, not supported for SVG text in all browsers).
- initialSets the property to its initial value.
- inheritTakes the computed value of the parent element.
Example
Browser Support
The following information will show you the current browser support for the CSS baseline-shift property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop





Tablets & Mobile






-
Supported Unknown Not supported
Sponsors
Password Manager
PasswordPal stores your passwords and private notes behind encryption that happens in your browser.
Copy Paste List
Copy and paste or download lists in your preferred format, including plain text, PDF, or HTML.
Unicode Characters & Emojis
Search all Unicode characters and emojis plus other tools.
Check Shortened URLs
Expand shortened URLs to view the destination link.
Advertise Here
Advertise your company and products here!