SVG tag centering within Div - HTML CSS SVG

HTML CSS examples for SVG:svg element

Description

SVG tag centering within Div

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">

.myDiv{<!--   w  ww.jav  a2s  . co  m-->
   background-color: Yellow;
   margin: 5px;
   padding: 5px;
}
.redDiv
{
   background-color: #F00;
   height: 30px;
   width: 30px;
   border-radius: 50%;
   position:absolute;
   top:140px;
   left:140px;
}


      </style> 
 </head> 
 <body> 
  <div class="myDiv"> 
   <svg style="background-color: blue;
    margin: 70px;
    padding: 5px;
    width: 150px;
    height: 150px;"> 
   </svg> 
   <div class="redDiv"></div> 
  </div>  
 </body>
</html>

Related Tutorials