2017-01-02 179 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

回答