多重背景图片(background属性缩写)

多重背景图片
格式
background: url("images/animal1.png") no-repeat,url("images/animal2.png") no-repeat;

在这里插入图片描述

加入定位属性分开图片
background: url("images/animal1.png") right top no-repeat ,url("images/animal2.png") left top no-repeat ;

在这里插入图片描述

注意点:

1.多张背景图片之间用逗号隔开即可。

2。先添加的背景图片会盖住后添加的背景图片。

3.建议在编写多重背景图片时,拆开编写。

background:
url("images/animal1.png") right top no-repeat ,url("images/animal2.png") left top no-repeat ,url("images/animal3.png") left bottom no-repeat ,url("images/animal4.png") right bottom no-repeat ,url("images/animal5.png") center center no-repeat;
拆开后为
/*专门用来保存图片地址*/
background-image: url("images/animal1.png"),url("images/animal2.png"),url("images/animal3.png"),url("images/animal4.png"),url("images/animal5.png");
/*专门设置是否平铺*/
background-repeat: no-repeat,no-repeat,no-repeat,no-repeat,no-repeat;
/*专门设置背景图片绝对定位*/
background-position: left top,right top,left bottom,right bottom,center center;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值