开发者

css background static?

开发者 https://www.devze.com 2023-01-18 02:04 出处:网络
if i wanted a background that deosnt m开发者_如何学JAVAove(stays static) so only the page moves when scrolling, if you get what i mean!!

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

精彩评论

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