text-anchor

An SVG-specific property used to align a string of text relative to its starting point. It's essentially 'text-align' but for text elements inside an <svg>.

Quick example

text.label {
  /* Aligns the center of the text string to the X coordinate provided */
  text-anchor: middle;
}

Quick facts

Initial value
start
Inherited
Yes
Applies to
SVG text content elements
Animation type
discrete

Values

startmiddleend

text-anchor Browser Support

Widely available Since 2020 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.

Safe to use without fallbacks.

1+
3+
4+
14+
ESC