The text-anchor attribute is used to align (start-, middle- or end-alignment) a string of pre-formatted text or auto-wrapped text where the wrapping area is determined from the inline-size property relative to a given point.
This attribute is not applicable to other types of auto-wrapped text. For those cases you should use text-align. For multi-line text, the alignment takes place for each line.
The text-anchor attribute is applied to each individual text chunk within a given element. Each text chunk has an initial current text position, which represents the point in the user coordinate system resulting from (depending on context) application of the x and y attributes on the element, any x or y attribute values on a or element assigned explicitly to the first rendered character in a text chunk, or determination of the initial current text position for a element.
Note: As a presentation attribute, text-anchor can be used as a CSS property. See text-anchor for more.
You can use this attribute with the following SVG elements: