title: Resize background image in div using css
body: <p>Below css sets an individual background on two divs; the images repeat themselves if they do not fit into the div size. </p>
  
  <p>How can I stretch the images using css to fit into space required by div ?</p>
  
  <pre><code>&lt;style type="text/css"&gt;   
  #contentMain {  
    margin-bottom: 5%; 
    margin-top: 10%;
    margin-left: 10%;
    margin-right: 10%;
    background: url( /jQuery/mypage/img/background1.png )
  }  
  #page1 {    
    background: url( /jQuery/mypage/img/background2.png )  
  } 
  &lt;/style&gt; 
  </code></pre>