Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The alignment-baseline attribute specifies how an object is aligned with respect to its parent. This property specifies which baseline of this element is to be aligned with the corresponding baseline of the parent. For example, this allows alphabetic baselines in Roman text to stay aligned across font size changes. It defaults to the baseline with the same name as the computed value of the alignment-baseline property.
Note: As a presentation attribute, alignment-baseline also has a CSS property counterpart: alignment-baseline. When both are specified, the CSS property takes priority.
You can use this attribute with the following SVG elements:
| auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | top | center | bottom |
| auto |
| Yes |
The value is the dominant-baseline of the script to which the character belongs - i.e., use the dominant-baseline of the parent.
baselineUses the dominant-baseline choice of the parent. Matches the box's corresponding baseline to that of its parent.
before-edgeThe alignment-point of the object being aligned is aligned with the "before-edge" baseline of the parent text content element.
text-bottomMatches the bottom of the box to the top of the parent's content area.
text-before-edgeThe alignment-point of the object being aligned is aligned with the "text-before-edge" baseline of the parent text content element.
Note: This keyword may be mapped to text-top.
Aligns the vertical midpoint of the box with the baseline of the parent box plus half the x-height of the parent.
centralMatches the box's central baseline to the central baseline of its parent.
after-edgeThe alignment-point of the object being aligned is aligned with the "after-edge" baseline of the parent text content element.
text-topMatches the top of the box to the top of the parent's content area.
text-after-edgeThe alignment-point of the object being aligned is aligned with the "text-after-edge" baseline of the parent text content element.
Note: This keyword may be mapped to text-bottom.
Matches the box's ideographic character face under-side baseline to that of its parent.
alphabeticMatches the box's alphabetic baseline to that of its parent.
hangingThe alignment-point of the object being aligned is aligned with the "hanging" baseline of the parent text content element.
mathematicalMatches the box's mathematical baseline to that of its parent.
topAligns the top of the aligned subtree with the top of the line box.
centerAligns the center of the aligned subtree with the center of the line box.
bottomAligns the bottom of the aligned subtree with the bottom of the line box.
SVG 2 introduces some changes to the definition of this property. In particular: the values auto, before-edge, and after-edge have been removed. For backwards compatibility, text-before-edge may be mapped to text-top and text-after-edge to text-bottom. Neither text-before-edge nor text-after-edge should be used with the vertical-align property.
For object alignment in other elements (such as <text>), see dominant-baseline.
| CSS Inline Layout Module Level 3 # alignment-baseline-property |
| Scalable Vector Graphics (SVG) 2 # AlignmentBaselineProperty |
Enable JavaScript to view this browser compatibility table.
This page was last modified on May 11, 2026 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.