html5——背景

背景大小

background-size: 50% 50%;//宽 高
background-size: 100px 100px;//宽 高
background-size: cover;//覆盖,图片会完全覆盖盒子,有可能显示不完整,缩放是等比例的
background-size: contain;//包含,背景图片会完全等比例,显示盒子中,有可能不会铺满盒子

背景裁剪

background-origin: border-box;//设置背景原点为border-box
background-clip:content-box;//只显示content区域

backgrond-clip:1、border-box    2、padding-box(默认padding)    3、content-box

多背景图片

background: url(images/bg1.png) no-repeat left top,
url(images/bg2.png) no-repeat right top,
url(images/bg4.png) no-repeat left bottom,
url(images/bg3.png) no-repeat right bottom,
url(images/bg5.png) no-repeat center center;

 

转载于:https://www.cnblogs.com/wuqiuxue/p/8064350.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值