title: How to show a background image over foreground image using CSS
body: <p>I want to set the background image so that it appears in front of foreground image. </p>
  
  <p>I tried the following code but it is not working as I expected:</p>
  
  <pre><code>.background-image
    {
        border :0px;
        background-image: url(/images/icon.png);  
        z-index:1000;      
    }
    .foreground-image
    {
        width:200px;
        height:113px;
        border :0px;
        z-index:1;
    }
  
  &lt;div&gt;
      &lt;a href="#" class="background-image"&gt;
          &lt;img class="foreground-image" src="./images/pic1.jpg"  /&gt;            
      &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am using CSS2.</p>