Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Jquery add div with background behind text element
  2. .div-1 { background-image:url(my-image.jpg) no-repeat 0 0; position:relative; }
  3. .div-2 { position:absolute; z-index:1; top:0 left:0; }
  4. .div-3 { position:absolute; z-index:2; top:0 left:0; }
  5.  
  6. <div class="div-1">
  7.  <div class="div-2">behind</div>
  8.  <div class="div-3">in front</div>
  9. </div>