2016-06-15 9 views
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> 

私はリンクを2つの行に分割しようとしています。私は
、\ n、空白を試していました:正常で、どれも動作していません。アドバイスが必要です。テキストタグ内のテキストを改行しないでください

+0

[?どのようジャバスクリプト内のSVGのテキストを改行する]の可能な重複(http://stackoverflow.com/質問/ 16701522/how-to-linebreak-an-svg-text-within-javascript) – mplungjan

答えて

1

ブロックレベルの要素にする必要があります。 次のコードは動作します:

<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> 
+1

それはすべての単語で壊れます – mplungjan

+0

これは、要素に幅10pxを与えたからです。 幅は、要件に応じて調整することができます。 –

+0

それも修正する必要がありますか? – mplungjan

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>

+0

近所の家:http://stackoverflow.com/questions/16701522/how-to-linebreak-an-svg-text-within-javascript – mplungjan

関連する問題