开发者

css background static?

if i wanted a background that deosnt m开发者_如何学JAVAove(stays static) so only the page moves when scrolling, if you get what i mean!!

this is my background code:

 background: #fff url(back1.png) ;


As you're using the shorthand background property, just add fixed to the end of the rule:

background: #fff url(back1.png) fixed;

This is actually the background-attachment property, so if you expand it out it's this:

background-color: #fff;
background-image: url(back1.png);
background-attachment: fixed;


Just add:

background-attachment: fixed;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜