title: css - change an image frequently with less server requests
body: <p>I have a  in html. Its content is described in css.
  With different functions the classname of the div is changed to imageholder1,2 etc.</p>
  
  <pre><code>.imageholder1 {      content: url('image1.png')}
  .imageholder2 {      content: url('image2.png')}
  </code></pre>
  
  <p>But I think this causes multiple server requests , each time the classname is changed.</p>
  
  <p>Is there a way to reduce the server requests to the image file.
  I would like a way to store the image into a variable and then point it from css code. Is it possible?</p>
  
  <p>I also tried to use a css image sprite but I need to need a more flexible way.</p>