CSS baseline-shift Property

Description

The baseline-shift property allows repositioning of the dominant-baseline relative to the dominant-baseline. The shifted object might be a sub- or superscript. Within the shifted element, the whole baseline table is offset; not just a single baseline. For sub- and superscript, the amount of offset is determined from the nominal font of the parent.

The baseline-shift property has been deprecated or is no longer in any CSS working groups.

Initial value
baseline
Applies to
Inline-Level elements
Inherited
No
Media
Visual
Computed value
-
Animatable
No
CSS Version
CSS3
JavaScript syntax
object.style.baselineShift

Syntax

baseline-shift: baseline | sub | super | <percentage> | <length>

Values

  • baselineThere is no baseline shift; the dominant baseline remains in its original position.
  • subThe dominant baseline is shifted to the default position for subscripts. The offset for this position is determined by the font data for the parent nominal font as adjusted by the dominant baseline-table font-size of the parent element. If there is no applicable font data the User Agent may use heuristic to determine the offset.
  • superThe dominant baseline is shifted to the default position for superscripts. The offset for this position is determined by the font data for the parent nominal font as adjusted by the dominant baseline-table font-size of the parent element. If there is no applicable font data the User Agent may use heuristic to determine the offset.
  • <percentage>The computed value of the property is this percentage multiplied by the computed 'line-height' of the parent element. The dominant-baseline is shifted in the shift-direction (positive value) or opposite to the shift-direction (negative value) of the parent area by the computed value. A value of '0%' 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 area by the [length] value. A value of '0cm' is equivalent to 'baseline'.

Example

.class {
   baseline-shift: sub;
}

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
??????
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
??????