Use t span and preserve space in SVG embedded in HTML - HTML CSS SVG

HTML CSS examples for SVG:Text

Description

Use t span and preserve space in SVG embedded in HTML

Demo Code

ResultView the demo in separate window

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head> 
  <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8"> 
  <title>Whitespace in SVG in HTML</title> 
 </head> <!--from ww  w  . java2 s . c o m-->
 <body> 
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 100 100"> 
   <text font-size="10" fill="black"> 
    <tspan dy="10" xml:space="preserve">
      this is a test
    </tspan> 
   </text> 
  </svg>  
 </body>
</html>

Related Tutorials