Welcome to WebmasterWorld Guest from 3.214.184.196

Forum Moderators: not2easy

Message Too Old, No Replies

Centering problem in IE

When centering with CSS, IE has a 1px offset between background and others

     
7:07 pm on Mar 29, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 29, 2005
posts:3
votes: 0


<snip>

Okay, at that URL, if you open it up in firefox or any other decent browser, you'll see a green box representing page content perfectly centered over a background image, with a white field exactly the width of the green box.

No border, no margins, no padding, etc.

In IE, and ONLY AT CERTAIN WINDOW SIZES, I get a 1px offset, causing the green box to be "pushed" 1 pixel to the left of the white area on the background (or vise versa).

This doesn't happen at every window size. For example, with my browser full-screen at 1280x1024, I see it, but if I resize my browser to a smaller window (around 800px, but not sure), then I don't see it.

If you don't see it, please try resizing your browser window a bit - trust me, it's there.

I have stripped out everything I can, and what's in the file now is the essential markup representing a much larger project - Does anyone have any ideas what's happening here?

[edited by: engine at 9:57 am (utc) on April 1, 2005]
[edit reason] No urls, thanks. See TOS [webmasterworld.com] [/edit]

1:44 am on Mar 30, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 7, 2004
posts:89
votes: 0


Sorry to say that I can't see anyway around that problem, it looks like its and IE rendering problem.

On another note have a read of the Terms of Service on this forum. You are not meant to post links to your site.

Good luck

-Harvs-

10:20 pm on Mar 30, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 29, 2005
posts:3
votes: 0


Followup: I don't know why it works, but when I increased the width of the background image from 800-whatever pixels to 1700, the problem disappeared. My only guess is that whatever rounding error is causing IE to center things incorrectly is no longer a problem when the background is wider than the browser window.