dustinnoe Posted October 22, 2006 Share Posted October 22, 2006 I have a CSS layout which has a centered backgroung image that gives the illusion that the page column extends to the bottom of the browser. I also have a centered DIV that hold the contents of the entire page. For some reason, both FF and IE, interperet the center of these two page elements differently depending on the width of the browser window. You can check it out at:[url=http://www.virtuosoweb.com/cr/]http://www.virtuosoweb.com/cr/[/url]As you are viewing the page, slowly expand the window and watch as the center of these elements change by 1 pixel. It's really annoyingThanks,Dustin Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted October 22, 2006 Share Posted October 22, 2006 try giving contentWrapper a margin of 5px and removing the padding. Quote Link to comment Share on other sites More sharing options...
dustinnoe Posted October 23, 2006 Author Share Posted October 23, 2006 I do not think that will affect the page considering that contentWrapper is contained in pageWrapper. The problem lies in how a web browser determines the center of the page and why it centers a background image differently than a div element. Quote Link to comment Share on other sites More sharing options...
dustinnoe Posted October 23, 2006 Author Share Posted October 23, 2006 The problem occurs when the width of the browser is an even number of pixels due to the fact that the width of the background and pageWrapper div are an odd number of pixels wide. When the brower is an odd number of pixels wide there is no problem. This means when the browser is an even number of pixels wide there are two pixels that share the center. For some odd reason, and I stress odd, the brower says, " I will choose the left center pixel to align the div element and the right center pixel to align the background image." Why would Mozilla and Microsoft design browers that do annoying crap like this! They have to know about it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.