0

I have a background image for a site that looks fine in firefox,chrome, and safari. IE however, the image shows up on the top of the page. what am i missing?

  #background {
width: 100%;
height: 100%;
position: fixed;
left: 0px;
top: 0px;
z-index: -999; /* Ensure div tag stays behind content; -999 might work, too. */
    opacity:.09;
  filter:alpha(opacity=9);
 }


.stretch {
width:100%;
height:100%;
}

html:

  <div id='background'><img src='<?php echo $bg;?>' class='stretch'></div>
   //rest of page//

where $bg is path to a image.

bart2puck
  • 2,432
  • 3
  • 27
  • 53

2 Answers2

0

Just use PHP in an inline style:

<div id="background" style="background-image:url(<?php echo $bg; ?>);">

disinfor
  • 10,865
  • 2
  • 33
  • 44
0

I think you want to achieve a full page background this will helpful for you.

http://css-tricks.com/perfect-full-page-background-image/

Good luck!

Aamir Shahzad
  • 6,683
  • 8
  • 47
  • 70