2 replies [Last post]
erikkerr
erikkerr's picture
User offline. Last seen 1 year 39 weeks ago. Offline
newbie
Timezone: GMT-7
Joined: 2010-08-18
Posts: 2
Points: 3

Hey everyone, weird problem.

This works fine in IE8, Firefox, Chrome, etc but causing an issue in IE7

I have an extra large background image (1600 pixels, a large graphic that fades away on the left and right ends for wide screens) and I simply want it top and centered. What happens in IE7 is that it moves to the top fine, but it won't center, it's very left point starts at the left of the screen.

It's very basic code like this:

body {background:url(img/bg.jpg) #ffa200 no-repeat top center; }
#container {width:940px; margin:0 auto; height:300px; }

main content here. the container centers fine. its just the body background image that is the issue.

CupidsToejam
CupidsToejam's picture
User offline. Last seen 17 weeks 5 hours ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2008-08-15
Posts: 2634
Points: 1552

maybe you can provide a link,

maybe you can provide a link, so we can "see" the problem


First basic few steps in building a webpage
1. Gather and collect content.
2. Organize the content into meaningful semantic valid HTML
3. Design the prototype
4. Style using CSS

http://www.pixelbehavior.com

erikkerr
erikkerr's picture
User offline. Last seen 1 year 39 weeks ago. Offline
newbie
Timezone: GMT-7
Joined: 2010-08-18
Posts: 2
Points: 3

so i just figured it

so i just figured it out.

there was an element within the container that was being absolute positioned and the margin property for that absolute position in IE7 was throwing it WAY to the right off the screen, increasing the screen width, thus throwing the background off-centered for IE7

ohhhh the time i spent trying every single little adjustment for the background, and the issue wasn't even there haha Smile