how to add text into figures? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

how to add text into figures?

7th Aug 2016, 7:30 AM
jimmy chaudhary
jimmy chaudhary - avatar
4 Réponses
+ 1
do you mean including text inside of you svg? if that is the case you would insert the text element like so: <svg width="300" height="300"> <text x="85" y="124">Text in SVG</text> </svg>
21st Aug 2016, 4:11 AM
Amanda Cochran
Amanda Cochran - avatar
0
what do you mean? I can't understand
9th Aug 2016, 12:59 PM
David Aragorn P. Telmo
David Aragorn P. Telmo - avatar
0
Ok, you can just add text ON figures, not Into. Right in svg-area. But you need to accounting some coordinates/place fo your text. My code #1 Text in random SVG-area <svg width="250" height="250" stroke="black" stroke-width="3"> <circle cx="130" cy="130" r="100" fill="green"/> <text x="10" y="130" fill="red" font-size="50px"> Text in SVG </text> </svg> My code #2 Text on figure <svg width="300" height="250" stroke="black"> <circle cx="130" cy="130" r="100" fill="green" stroke-width="5"/> <text x="10" y="130" fill="red" font-size="50px"> Text in SVG </text> </svg> My code#3 Text is on correct side, by adding the "text-anchor" attribute: <svg width="300" height="250" stroke="black"> <circle cx="130" cy="130" r="100" fill="green" stroke-width="5"/> <text x="130" y="130" fill="red" font-size="25px" text-anchor="middle"> Text in SVG </text> </svg> Sorry for my English, I'm from Russia
8th Sep 2016, 6:39 PM
Rihter Inside
Rihter Inside - avatar
- 1
jsjs
8th Aug 2016, 10:13 AM
Haeas Darwesh
Haeas Darwesh - avatar