Click to See Complete Forum and Search --> : Background image not centered in FF


jcordoba
12-06-2007, 10:57 AM
Hello to all, hope you can help me in some way (even moral).

My website is a 1003px centered table with two columns (right/left) that has to run all the way from top to bottom.

To achieve this, i set a background image that aligns with the columns of the table and works perfectly in IE7, even when the browser window size is smaller than the 1003px and the horizontal scrolling bar appears, the background and the table aligns.

But in FF2, when the browser window is smaller than the 1003px, the background which is set to center is "pushed" to the left, and does not aligns with my table anymore.

A brute-force way to avoid this, would be to be able to identify when the window size is lower than the 1003px and change the background position from "center" to "left".

However, i'm looking for some attribute that in firefox, prevents the background from beign centered (and ultimately it's left margin hidden) when the inner-width is lower than the 1003px. Note that in IE7 and the window is small, it is how it works, the background is stopped from beign centered and remains with a fixed position to the left which allows the alignment with my table.

My code:

background: url(template/insideFinal_01.jpg);
background-position:center top;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
height: 100%;

My URL: http://villa.infolinksa.com/ws/EmiCurnow/CURNOWANDCURNOW/intranetlogin.asp
Try viewing the page in different window size both in IE7 & FF2

THANKS! :D

TJ111
12-06-2007, 11:34 AM
First of all, I don't have that problem in FF. Second of all, you might want to try validating your page. Here's another interesting error I found, although I don't think it would affect FF.

body{
marging:0px 0px 0px 0px;

background: url(template/insideFinal_01.jpg);
background-position:0 0;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;

}

Siddan
12-06-2007, 12:27 PM
I am sorry,, I cannot bare to debug your site.. takes very long time to load and on FF I always get a message something about firefox and every time I resize the page will reload....

drhowarddrfine
12-06-2007, 12:32 PM
Never, ever use IE as a reference to how things should work. All versions of IE are 10 years behind web standards and buggy. Always check in a modern browser first, such as Firefox, Opera or Safari. Then adjust for IEs bugs and quirks.

jcordoba
12-06-2007, 12:45 PM
Thanks for the response TJ but I needed a quick fix so i coded a snipet that detects the browser, when it is FF it retrieves the inner width, when it's les than 1003 then it dynamically changes the background position so instead of being centered, it is positioned to the left and it worked.

jcordoba
12-06-2007, 12:47 PM
Siddan, i was coding in javascript that's why you get that alert but now it seems to be finished.

drhowardrdfin, you're right! i'll keep in mind next time.

Regards.

Major Payne
12-07-2007, 12:02 PM
Not sure if it was mentioned directly, but validator may catch it. All values that are zero (0) do not need the unit. Remove things like 0px where ever they are. Also, no need to list all the margins if all are set to zero. margin: 0; will do fine. Might want to add the Universal Selector at the very beginning of your CSS. Keeps some browsers in their place. :p

Ron

Major Payne
12-07-2007, 12:12 PM
Never, ever use IE as a reference to how things should work. All versions of IE are 10 years behind web standards and buggy. Always check in a modern browser first, such as Firefox, Opera or Safari. Then adjust for IEs bugs and quirks.O.T.: IE 8 is on its way. Wonder how far behind it will be? :D

Gates: Next IE to be IE8 (http://internetexplorer8.net/)
It's IE8 vs. Firefox 4 for 2008 (and animal noises) (http://blogs.computerworld.com/node/4342)
Internet Explorer 8 is the name (http://www.downloadsquad.com/tag/ie8/)

BTW, hope no one is DLing the IE 8 appearing on Peer-to-Peer servers. Fakes and possibly virus laden.

Ron

WebJoel
12-07-2007, 01:04 PM
I was just reading about the upcoming 'service packs' due next year, one for VISTA and one for XP.
The VISTA service pack actually slows down VISTA even more(!!), while the XP service pack speeds-up XP by 10%... And M$ seems happy with that.

Hey, -Linux, and gOS, are doing fine.. :p

drhowarddrfine
12-07-2007, 06:28 PM
O.T.: IE 8 is on its way. Wonder how far behind it will be? :D

Gates: Next IE to be IE8 (http://internetexplorer8.net/)
It's IE8 vs. Firefox 4 for 2008 (and animal noises) (http://blogs.computerworld.com/node/4342)
Internet Explorer 8 is the name (http://www.downloadsquad.com/tag/ie8/)

BTW, hope no one is DLing the IE 8 appearing on Peer-to-Peer servers. Fakes and possibly virus laden.

Ron
Yep. Did you see my thread in the General forum? As you know, even Gates said IE8 won't be what everyone wants it to be.