1
<text x="216.7265625" y="191.21875" text-anchor="middle" font="10px &quot;Arial&quot;" stroke="none" fill="#000000" style=" -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-anchor: middle; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Arial; cursor: move; width: 10px;" font-size="12px"><tspan dy="4" style=" -webkit-tap-highlight-color: rgba(0, 0, 0, 0); ">F. Downturn in numbers of different graphic novels being produced.</tspan></text>

I am trying to break the link into two lines. I had tried
, \n, white-space: normal and none of them are working. Need advice.

  • Possible duplicate of [How to linebreak an svg text within javascript?](http://stackoverflow.com/questions/16701522/how-to-linebreak-an-svg-text-within-javascript) – mplungjan Jun 15 '16 at 05:57

2 Answers2

1

You need to make it a block level element. The code below will work:

<text x="216.7265625" y="191.21875" text-anchor="middle" font="10px &quot;Arial&quot;" stroke="none" fill="#000000" style="display: inline-block;width: -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-anchor: middle; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Arial; cursor: move; width: 10px;" font-size="12px"><tspan dy="4" style=" -webkit-tap-highlight-color: rgba(0, 0, 0, 0); ">F. Downturn in numbers of different graphic novels being produced.</tspan></text>
mplungjan
  • 169,008
  • 28
  • 173
  • 236
Karan Batra
  • 106
  • 2
1

tutorials jenkov.com svg tspan-element

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">

    <text y="20">
        <tspan x="10">tspan line 1</tspan>
        <tspan x="10" dy="15">tspan line 2</tspan>
        <tspan x="10" dy="15">tspan line 3</tspan>
    </text>
</svg>
mplungjan
  • 169,008
  • 28
  • 173
  • 236
Saika
  • 398
  • 3
  • 14
  • Closer to home: http://stackoverflow.com/questions/16701522/how-to-linebreak-an-svg-text-within-javascript – mplungjan Jun 15 '16 at 05:59