http://jsfiddle.net/stapia开发者_运维技巧gutierrez/hfhfp/
For example, I'd like the user to scroll down, but the image to not move.
Any suggestions to my CSS?
Similar to http://www.mobafire.com/ where the picture is set, but the scrolling doesn't move it.
You need to assign backgroun-attachment property to fixed for body element. i.e:
body{
background: url('http://i.stack.imgur.com/6C5Ym.jpg');
background-repeat:no-repeat;
background-attachment:fixed;
}
Check jsFiddle@: http://jsfiddle.net/hfhfp/2/
Add fixed to the background properties like so :
body{
background: url('http://i.stack.imgur.com/6C5Ym.jpg') fixed no-repeat;
}
精彩评论