title: How do you stretch a Background Image
body: <p>I have a gradient background that I'm using like follows in an ASP.Net Webforms application:</p>
  
  <pre><code>&lt;div style="background-image: url(foo.jpg) repeat-x;"&gt;
      ... Injected HTML codes
  &lt;/div&gt;
  </code></pre>
  
  <p>Where foo.jpg is a 200x1 pixel image.   My problem is this, the height of the injected HTML varys from about 200px to 1000+px depending on size of a datagrid.   Also, this segment is part of a much larger page that uses  for positioning content.</p>
  
  <p>What I would like is that after the HTML is injected, have the background automatically stretch to fit the space so that the gradient is applied smoothly over the entire height.</p>