title: background tiled with flexible background image on top (oh - and a shadow)
body: <p>I have a site design that uses background images and textures as a feature of the site.</p>
  
  <p>See background design concept here: <a href="http://www.flickr.com/photos/54233587@N03/6145240784/in/photostream" rel="nofollow">http://www.flickr.com/photos/54233587@N03/6145240784/in/photostream</a></p>
  
  <p>The background is intended to work like this:</p>
  
  <p>The page background has a tiled pattern (or on some pages there will be solid background colour).</p>
  
  <p>The top part of the background is overlayed with a background image. The background image is a large image (2000px wide) and needs to be centred in the window. Depending on the page, the height of the image will crop from the bottom (that is, on one page the image may need to be 400px, while on others it may be 450px). This background image also has a CSS3 box-shadow applied so there is a slight shadow at the bottom of the image. This background image cannot use a fixed position - that is, it should move with the page if it is scrolled.</p>
  
  <p>All other page content sits on top of the background in a centered div, indicated by the black box in the screenshot.</p>
  
  <p>I have tried to achieve this by targeting the HTML5 html node for the tiled background.</p>
  
  <pre><code>html {
      background: url(../img/pegboard.jpg) repeat center;
  }
  </code></pre>
  
  <p>Then, for the overlaying background image I've been using a div element to insert an image.</p>
  
  <pre><code>&lt;div id="bgimage"&gt;&lt;img src="mybgimage.jpb"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Then styling the img to try and center, not be fixed when scrolling, and resize the div to crop image from bottom. All without much success.</p>
  
  <p>Thanks.</p>