2017-01-02 102 views
0

考慮這個SVG:標籤寬度

<svg xmlns="http://www.w3.org/2000/svg"> 
 
\t <defs> 
 
\t \t <style type="text/css"><![CDATA[ 
 
\t \t \t .code { 
 
\t \t \t \t font-family: monospace; 
 
\t \t \t \t white-space: pre; 
 
\t \t \t \t tab-size: 4; 
 
\t \t \t } 
 
\t \t ]]></style> 
 
\t </defs> 
 
<text class="code" fill="black" font-size="16" x="0" y="16"> 
 
{ 
 
</text> 
 
<text class="code" fill="black" font-size="16" x="0" y="32"> 
 
\t let r;   
 
</text> 
 
</svg>

呈現時,你可以看到,標籤尺寸顯然是1米的空間。我怎樣才能解決這個問題?我使用的Chrome顯然支持tab-size

+0

您需要分別爲firefox和opera添加供應商特定標籤'-moz','-o'。 '-moz-tab-size:4;''-o-tab-size:4;' – pol

回答