CSS资料之背景属性

◆ 背景属性:

★ background-color:背景颜色
background-color: grey;
★ background-image:背景图片
background-image:url("1.jpg");
★ background-repeat:背景平铺
repeat(默认)  |  no-repeat |   repeat-x   |  repeat-y
background-repeat: no-repeat;  
★ background-position:背景定位
left  |  right  |  center  |  top  | bottom
★ Background-attachment:背景是否滚动
scroll  |  fixed


◆ background-position:

1、方位值只写一个的时候,另外一个值默认居中。

backgroud-position: right;

2、写2个方位值的时候,顺序没有要求。

background-position: right bottom;

3、写2个具体值的时候,第一个值代表水平方向,第二个值代表垂直方向。

background-position: 20px 30px;


◆ 背景属性连写:

连写的时候没有顺序要求,url为必写项。

background: red url("1.jpg") no-repeat 30px 40px scroll;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值