View Full Version : Background image movement

04-17-2011, 11:31 PM
hi this is my first post so im sorry if its in the wrong place, i tried a search but couldnt find what i was looking for.

my problem is that the site im making the main background image is moving to the left when the window is resized but the header and menu backgrounds are staying centered where i want them.

this happens both in IE and FF

here's a link to the construction page as you can tell it happens on all of them :confused:

any help would be appriciated :)



04-18-2011, 07:47 AM
Have a try with:

body {
background-image: url("images/bg.png");
background-position: center top;

#wrap {
background-color: #FFFFFF;
margin: 0 auto;
width: 1070px;

margin:0 auto will centre the #wrap on your page regardless of the size of the viewport window, and the background-position: center will do the same for your background image.

EDIT: Just realised you're in Silsden. I'm just up the road in Ilkley. Small world...

04-18-2011, 06:26 PM
Haha it really is!

I'll have a crack at it later on this week and let u know as I've got to go back to Uni for exams :(

Just out of curiosity are there any improvements u think I could make or do u know of a php/database gallery I could use nt so fond of the one I've got auto update via FTP would be perfect :thumbsup:


04-24-2011, 10:49 AM

i tried that but still to no avail :(

ive decided to use a new style looks better and doesnt go funny

thanks for your help anyway

04-25-2011, 08:07 AM
You should be using absolute position for your images in CSS