title: Loading CSS background images before normal images?
body: <p>I have a ruby on rails web app, and in some views i have many heavy images( <code>&lt;img&gt;</code> ) to render .The <code>&lt;img&gt;</code> are generated in a Helper.</p>
  
  <p>The problem is that the css is loaded first, then the js, then the heavy images , and then finally the css refereneced background images.</p>
  
  <p>It takes quite a while for all of the heavy images to load, which therefore holds the whole site up. </p>
  
  <p>I want to load first the css background images then load the other images, as they obviously hold visual structure of the page.</p>
  
  <p>rails version: 2.3.8</p>
  
  <p>EDIT: 
  Thank you guys, I apologize for not having shared the code earlier.</p>
  
  <p>I have two models : Categories and Images, each Category has many images.
  In the view i have a list of categories, which is generated by a helper :</p>
  
  <p><pre> 
  categories.each do |cat|
      html &lt;&lt; <code>"&lt;a href='##{cat.id}' class='mapcat' &gt;#{cat.libelle}&lt;/a&gt;"</code>
  end
  </pre></p>
  
  <p>and when I click on the category the images are displayed</p>
  
  <p><pre>
   categories_images.each do |i|
      html &lt;&lt; <code>"&lt;div id='#{i.id}' class='#{css}'&gt;&lt;img src='/images_moi/categories/#{cat.libelle}/#{i.path_file_name}' /&gt;"</code>
    end
  </pre>  </p>
  
  <p>I have css background image associated to the list of category
  The problem is that the images (<code>&lt;img&gt;</code>) is displayed before the css background images of the list of categories.</p>