View Full Version : Background image doesn't move along when resizing browser window using IE


skyeasinsark
12-07-2004, 08:32 PM
So, I've tried anything I could think of to make the borderpicture, that I am using as background image, move along with the rest of my page when I resize the page in IE, but nothing works, so if anyone can come up with a couple of ides I could try out...
Here is the relevant CSS, since it works fine in Firefox, I am using an IE hack.

body {
background-image: url(http://foolish-mind.net/images/layout/borders.gif);
background-repeat:repeat-y;
background-position: center;
width: 550px;
height: 100%;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 0.6em;
color: #6B6A6A;
margin: 0px auto;
padding: 0px;
}


and the hack


* html body {
background-position: 226px top;
}


The hack makes the backgroundpicture align properly with the rest of the image, but of course when I resize it stays put, messing up the whole layout...

If you want to have a look at the site, http://foolish-mind.net/about.php

Thanks

Monkey Bizzle
12-07-2004, 08:43 PM
i looked at that pic that you have there, the borders.gif, and i don't see anything but a blank page...

kittycat
12-07-2004, 09:43 PM
Because the background is very small height-wise and a light colour...

The background is being positioned horizontally with an absolute number. The page content is being centred. You can't mix an absolute value with non absolute, and have it come out all right.
Have you tried it without the IE hack for the background in there? because it should centre the background...

skyeasinsark
12-08-2004, 09:13 AM
I got rid of the pourcentages and the hack and now, strangely enough, the picture is still not aligned, but when you resize gradually in IE now, it actually jumps from being in the right position back to the wrong one...but it's a tad better...so thanks for that tip already..