title: HTML - Loading background images in order
body: <p><strong>Hi:</strong></p>
  
  <p>I created a photography portfolio for myself:
  <a href="http://www.photography.tommcpadden.com/gallery" rel="nofollow">http://www.photography.tommcpadden.com/gallery</a></p>
  
  <p><strong>The Situation:</strong></p>
  
  <p>The photos in the gallery index are backgrounds images so they can fluidly change with the resolution while all being the same size and maintain ratio.</p>
  
  <p>But the photos in the gallery index are too big and take too long to load. They are 1000px in width on the desktop, and 700px in width on phones/tablets. To solve this issue, I created smaller versions of lower quality, hence file size, to load in an element underneath so the visitor has something to look at while the higher quality photo is loading, which works perfectly!</p>
  
  <p><strong>The problem:</strong></p>
  
  <p>The problem is that the browser sometimes loads the larger background image first, making this pointless.</p>
  
  <p><strong>The Code:</strong></p>
  
  <pre><code>&lt;li&gt;
      &lt;a href="LINK HERE"&gt;
          &lt;div class="photobg" style="backgrond:url('small.jpg');"&gt;
              &lt;div class="photobg" style="backgrond:url('big.jpg');"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>As you can see, both DIV tags have a background image, one over the other so that the small image will be replaced by the big image when the big image loads.</p>
  
  <p><strong>The Goal:</strong></p>
  
  <p>I want to load the small background images before the big background images so the visitor has something to look at while the big ones are loading.</p>
  
  <p>If you have an alternative solution, I'd be happy to hear it.</p>
  
  <p>Thank you for your time :)</p>