CSS Background Color on an <IMG> using external SVG as the SRC - HTML CSS SVG

HTML CSS examples for SVG:Image

Description

CSS Background Color on an <IMG> using external SVG as the SRC

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

body {background:#252525;}
.logo{<!--  w  w w.ja v  a  2s  .  c  o  m-->
   position: relative;
   height: 400px;
   width: 237px;
}
.bg {
   position: absolute;
   top:10px;
   left:1px;
   height: calc(100% - 20px);
   width: calc(100% - 1px);
   background:yellow;
}
img{
   position: absolute;
   /* height: 100%; */
   width:100%;
}


      </style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="logo"> 
    <div class="bg"></div> 
    <img src="http://upload.wikimedia.org/wikipedia/commons/8/84/Konqi_svg.svg"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials