Display an SVG image as a div background - HTML CSS SVG

HTML CSS examples for SVG:Image

Description

Display an SVG image as a div background

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

pre {<!--from  www  .j a  va  2s . c o m-->
   outline: 2px dashed black;
   padding: 1em;
   background-image: url(http://upload.wikimedia.org/wikipedia/commons/8/84/Konqi_svg.svg);
   background-repeat: no-repeat;
   background-size: cover;
}


      </style> 
 </head> 
 <body> 
  <pre>
Some pre-formatted text.
Some pre-formatted text.
Some pre-formatted text.
Some pre-formatted text.
</pre> 
  <pre>
my
my
my
my
my
my
my
my
</pre>  
 </body>
</html>

Related Tutorials