SVG - how to set the length of a line of text

String-height seems to be one CSS property missing from svg text. The best SVG resource I have found is: Jenkov.com SVG Tutorials , and it is not mentioned either. Can I find a mention of this in MDN .

So, if someone can shed light on this or share a technique. My main concern is the spacing between lines of text that wraps, rather than independent text elements.

thanks

+7
javascript css svg
source share
1 answer

SVG 1.1 (officially) only supports single-line text, so there is no line-height .

I just tried to create a block of text in Inkscape and use the flowRoot element (containing the flowPara element with the actual text in it). Then the flowRoot element actually has the line-height assigned to it (in%).

I do not know how widespread such support is, since it was part of SVG 1.2 . You can also look here: Automatic wrapping of lines in SVG text

+6
source share

All Articles