CSS z-index property

CSS z-index property

 
z-index property in CSS is used to specify the stack order of an element.
 
Ex: Here we take an image as a background:
  1. <html>  
  2.   
  3.    <head>  
  4.       <style type="text/css">  
  5.       img {  
  6.          position: absolute;  
  7.          left: 50px;  
  8.          top: 0px;  
  9.          z-index: -1;  
  10.       }  
  11.       </style>  
  12.    </head>  
  13.   
  14.    <body>  
  15.       <img src="Penguins.jpg" width="100" height="100" />  
  16.       <p><b>My Name is Mahak Garg.</b></p>  
  17.    </body>  
  18.   
  19. </html> 
Output:
 
1.png