property

Dominant baseline — CSS reference

Determines the baseline used for text alignment and the default alignment baseline for participating descendants. In SVG, changing the dominant baseline changes which typographic reference line is associated with the text position. Font metrics affect the actual offset.

Formal Syntax & Structure

css syntaxcss
dominant-baseline: middle;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>dominant-baseline</title><style>body{margin:8px;font:16px/24px sans-serif}#a{dominant-baseline:middle}</style><body><svg width="300" height="100" viewBox="0 0 300 100"><text id="a" x="10" y="50" font-size="24">Base<tspan id="b">Sample</tspan></text></svg></body></html>
CSS Reference