开发者

How can I set a background image to the entire page of my site?

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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜