1

I'm making a site with a background image on every page. The image is centered in Chrome, Safari, Firefox... But it won't center in IE 9 (not sure about the other versions of IE).

Here's the CSS:

#page {
    background-image: url(images/mountain2.jpg);
    text-align: center;
    margin-top: -50px;
    margin-right: auto;
    margin-left: auto;
    background-repeat: no-repeat;
    background-color: #6C86FF;
    width:1292;
    height:972;
}

(#page, is the div tag for the entire site.)

Help, is very much appreciated. =)

nmagerko
  • 6,586
  • 12
  • 46
  • 71
Emily Magnuson
  • 165
  • 2
  • 3
  • 14

2 Answers2

1

Have you tried setting background-position: center center;?

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
0

I think you should have a look at the specs concerning Background, especially the background-position property.

Stock Overflaw
  • 3,203
  • 1
  • 13
  • 14
  • Very good idea. I took a look there, and I have a better understanding of the type of CSS elements that I can add to background. Thank you! – Emily Magnuson Mar 25 '12 at 20:05