Ok so I have some text and was wondering what the best way to get it to automatically span several lines when the window gets to small for it to be on one line?
Asked
Active
Viewed 2,374 times
0
-
possible duplicate of [Auto line-wrapping in SVG text](http://stackoverflow.com/questions/4991171/auto-line-wrapping-in-svg-text) – Erik Dahlström Feb 20 '12 at 08:58
-
seems to be what I want but for some reason it's not working. Here is what I have(its all being made with javascript). http://pastebin.com/gaQbW9LL – SalmonMode Feb 20 '12 at 10:14
1 Answers
0
Not really an answer, but a response to http://pastebin.com/gaQbW9LL.
One rather obvious error is that you're creating html elements but in the svg namespace:
var bodyEle = document.createElementNS(svgns,'body');
That should be, e.g:
var bodyEle = document.createElementNS(xhtmlns,'body');
where xhtmlns is http://www.w3.org/1999/xhtml
.

Erik Dahlström
- 59,452
- 12
- 120
- 139
-
Ok i looked into it but I got an error saying xhtmlns is not defined. Not sure what I'm missing but I feel like it's obvious. here is what I have now http://pastebin.com/eduuKTbu – SalmonMode Feb 20 '12 at 11:26