Is it possible to add text to an svg path, I have created a svg triangle and would like to add a letter to the center of this but not sure if this is possible?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
Yes. See section 10.13 of the SVG1.1 specification (titled "Text on a path") for information on using the
textPath
element.Summarized:
id
attribute.<textPath xlink:href="#pathid">My text here</textPath>
Here's an example straight from the spec: