Css Transforms on SVG elements - HTML CSS SVG

HTML CSS examples for SVG:Transform

Description

Css Transforms on SVG elements

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

.move {<!--   www .  j  a  v  a  2 s.  co m-->
   transform: translateX(50px)
}


      </style> 
 </head> 
 <body> 
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="0 0 200 200" enable-background="new 0 0 200 200" xml:space="preserve" width="200px"> 
   <rect fill="#444444" width="200" height="200"></rect> 
   <rect fill="#abcdef" width="100" height="100" class="move"></rect> 
  </svg> 
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="0 0 200 200" enable-background="new 0 0 200 200" xml:space="preserve" width="100px"> 
   <rect fill="#444444" width="200" height="200"></rect> 
   <rect fill="#abcdef" width="100" height="100" class="move"></rect> 
  </svg>  
 </body>
</html>

Related Tutorials