CSS alignment-baseline Property
Description
The alignment-baseline property in CSS is part of the SVG and text layout specification, and it primarily affects how inline-level elements, particularly text and inline graphics, align vertically relative to the baseline of their parent container or to each other. This property is often used with vertical-align in HTML, but it provides finer control over SVG text and graphics alignment.
Essentially, it tells the rendering engine which baseline of the element should align with the baseline of the parent or surrounding elements. Think of it as choosing a “reference line” within an element that other elements will line up to.
How it Works
Every inline element or text character has multiple baseline types:
- Alphabetic baseline: The line upon which most letters “sit” (e.g., a, e, x).
- Ideographic baseline: Used for East Asian scripts; characters like Chinese or Japanese have a different visual baseline.
- Hanging baseline: For scripts like Devanagari, where letters “hang” from a top line rather than sitting on a bottom line.
- Mathematical baseline: Used for math symbols.
- Central baseline: The vertical center of the element.
- Text-bottom / text-top: Related to the overall bounding box of the text.
alignment-baseline allows you to specify which of these baselines should be considered when aligning the element relative to other elements.
Key Notes
alignment-baselinedoes not move the element itself. It only affects how its baseline is interpreted for alignment purposes.- Most commonly used in SVG, but it also works in HTML inline elements when paired with
vertical-align. - Helps maintain typographic consistency across different scripts and inline elements of different heights.
Definition
- Initial value
- baseline
- Applies to
- Inline-Level elements
- Inherited
- no
- Computed value
- specified value
- Animatable
- yes
- JavaScript syntax
- object.style.alignmentBaseline
Syntax
alignment-baseline: baseline | text-bottom | alphabetic | ideographic | middle | central | mathematical | text-top
Values
- baselineAligns the alignment-point of the element with the dominant-baseline of the parent.
- text-bottomAligns the element to the very bottom of the parent's line box.
- alphabeticStandard alignment for Latin/Cyrillic scripts (the bottom of letters like 'a' or 'b').
- ideographicAligns to the bottom of the ideographic em box (used for Han scripts).
- middleAligns the vertical midpoint of the element with the parent's baseline (often used for icons/text).
- centralAligns the vertical center of the "em box" with the parent's baseline.
- mathematicalAligns the element according to the mathematical baseline (center of symbols like $+$ or $-$).
- text-topAligns the element to the very top of the parent's line box.
Example
Browser Support
The following information will show you the current browser support for the CSS alignment-baseline property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported in some modern browsers, but not all.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
