property

Baseline shift — CSS reference

Moves an SVG text run relative to its baseline; positive lengths raise the run in ordinary horizontal writing. Unlike translating an entire text element, it changes the baseline position of the selected run. The example compares its SVG bounding box before and after applying a length.

Formal Syntax & Structure

css syntaxcss
baseline-shift: 10px;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>baseline-shift</title><style>body{margin:8px;font:16px/24px sans-serif}#b{baseline-shift:10px}</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