tags:

views:

123

answers:

2

Hello,

This is going to be rather silly of me asking, but how do I keep the background image fixed during a page scroll. I have this css code, and the image is a background of the body and not <div></div>

    body{
 background-position:center;
 background-image:url(../images/images5.jpg);
}

Thanks Jean

+7  A: 
background-attachment: fixed;

http://www.w3.org/TR/CSS21/colors.html#background-properties

David Dorward
That would make the pic go off the center position
Jean
You might want to specify the y position as well as the x position then.
David Dorward
@david background: no-repeat-x no-repeat-y; does not seem to work, or if I am getting it wrong here
Jean
I said "position" not "repeat", and "no-repeat-x no-repeat-y" is made up garbage. I linked to the spec, it tells you what values are acceptable.
David Dorward
@david thanks, I need to play around with it, the image file is huge.
Jean
A: 

I think you answered your question ,

How to FIX backgorund >>>> background-attachment: fixed;

Nasser Hadjloo