Background image, centre of page, tiled horizontally

Associate
Joined
2 Aug 2005
Posts
680
I want to have a bar go across the page horizontally in the centre of the body, just wanted to check my css

Code:
	background-image:url(images/bar.jpg);
	background-repeat:repeat-x;
	background-position:50%;

This is working in IE, but not FF. It's weird because in FF the bar is appearing at the top, but from the middle of the bar (so it takes the 50% from the image, rather than the body). Is there a better (or right) way of doing this?

Thanks
 
Code:
background:url(images/bar.jpg) repeat-x center left;
That will repeat horizontially, centred vertically and starting from the left
 
Last edited:
Sorry, missed a line:
Code:
background:url(img/banner_bg.png) repeat-x center left;
background-attachment:fixed

That will work in IE and FF :)
 
Back
Top Bottom