text-anchor
Widely availableSince 202097% of users
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>.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyModernIn every major browser since August 2016. Widely available since February 2019.
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
start- Inherited
- Yes
- Applies to
- SVG text content elements
- Animation type
- discrete
Quick example
text.label {
/* Aligns the center of the text string to the X coordinate provided */
text-anchor: middle;
}Values
startmiddleendtext-anchor browser support
BaselineWidely availableThis 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.
Usage97%of people can use this3% use a browser without it.
Browsers
1+
3+
4+
≤14+Mobile
18+Android
4+Android
3.2+iOS