多背景图的设置

Posted rockyjs

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了多背景图的设置相关的知识,希望对你有一定的参考价值。

多背景图的设置

background-image:url(1.jpg),url(2.jpg);

background-image:url(1.jpg) no-repeat center/auto 200px,url(2.jpg)  no-repeat center/auto 300px ,...;

 

设置背景图是否固定或者随页面滚动而滚动

background-attachment : scroll   |   fixed   |  inherit

scroll:默认属性,设置背景图片随页面的其余部分滚动;

fixed :设置背景图像是固定的;

inherit:指定background-attachment的设置应该从父元素继承;

 

以上是关于多背景图的设置的主要内容,如果未能解决你的问题,请参考以下文章