property
Text anchor — CSS reference
Aligns a text chunk relative to its current text position. With middle, the chunk is centered horizontally on its x coordinate for ordinary horizontal text. It is different from CSS text-align on a block.
Formal Syntax & Structure
css syntaxcss
text-anchor: middle;Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>text-anchor</title><style>body{margin:0;background:white}svg{display:block}#a{text-anchor:middle}</style><body><svg xmlns="http://www.w3.org/2000/svg" width="240" height="160" viewBox="0 0 240 160" role="img" aria-label="SVG styling example"><text id="a" x="120" y="80" font-size="20">SVG</text></svg></body></html>