Add foreground image - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Add foreground image

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">
.MyImg {<!--from  w ww  . j  av a  2s  . co  m-->
   background:Chartreuse url('http://www.java2s.com/style/demo/Google-Chrome.png') center center no-repeat;
   position:fixed;
   top:0;
   left:0;
   height:100%;
   width:100%;
   z-index:1001;
}
</style> 
 </head> 
 <body> 
  <div class="content"> 
   <p>Content here</p> 
  </div> 
  <div class="MyImg"></div>  
 </body>
</html>

Related Tutorials