views:

108

answers:

3

I want to put a Background image centered in the body (backgroundPosition). And then I want all the content(text, tables....) I will add to the page to be aligned with the background, for example, If I zoom the Page, the proportions Background-Content should be respected.

I tried almost everything and I don't know if Its possible, I know if I use position top-left for background position and then content in float:left proportions will be respected, but If I want background centered?

A: 

Unfortunately for the background image to move as you scale the page you'll have to use javascript.

If javascript is an option for you, you'll be able to get the dimensions of the browser window, and calculate the center point and position the background accordingly.

Jeremy B.
+2  A: 

In the CSS:

background-position:center center;

That's not cutting it? Maybe you could put up a test page somewhere?

Chris
A: 

You could do:

background:url(path-here) center center;
Sarfraz