css背景图片样式
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
css背景图⽚样式/*背景图⽚ 1. 必须加url 2. url ⾥⾯的地址不要加引号*/
background-image: url(images/l.jpg);
}
/*默认的是平铺图 repeat*/
/*background-repeat: repeat;*/
/*背景图⽚不平铺*/
/*background-repeat: no-repeat;*/
/*横向平铺 repeat-x*/
/*background-repeat: repeat-x;*/
/*纵向平铺*/
background-repeat: repeat-y;
/*背景位置*/
/*background-position: x坐标 y坐标;*/
/*background-position: right top; 右上⾓*/
/*background-position: left bottom; 左下⾓*/
/*background-position: center center; ⽔平居中垂直居中*/
/*则两个值前后顺序⽆关因为是⽅位名词*/
/*background-position: center left; */
/*如果只指定了⼀个⽅位名词,另⼀个值默认居中对齐*/
background-position: top;
/*以下说明 x 10像素 y 垂直居中的*/
/*background-position: 10px center;*/
background-position: center 10px;
/*这种写法⼀般是我们以后超⼤背景图⽚的做法背景定位*/
background-position: center top;
/*背景固定的*/
background-attachment: fixed;
height: 3000px;
/*background-color: #ccc;
background-image: url(images/sms.jpg);
background-repeat: no-repeat;
background-position: center top;
background-attachment: fixed;*/
/*background: 背景颜⾊背景图⽚地址背景平铺背景滚动背景位置;*/ background: #ccc url(images/sms.jpg) no-repeat fixed center top;
background: rgba(0, 0, 0, .2); 背景透明。