1.背景样式
1.1 背景图片
/* 添加背景色后,填满视口 */
background-color: #099;
background-image: url( );
background-repeat: repeat;
background-repeat: no-repeat;
background-repeat: repeat-x;
background-repeat: repeat-y;
1.2 背景图片位置
/* 关键字表示*/
background-position: left top;
background-position: right top;
background-position: center top;
background-position: center center;
background-position: center bottom;
/* 只写一个值 另一个值为center*/
background-position: left;
background-position: right;
background-position: center;
background-position: top;
/* 坐标表示*/
background-position: -50px 100px;
background-position: 100px -10px;
/* 只写一个值 默认为X轴的值 Y轴值默认为center*/
background-position: 100px;
background-position: right 150px;
background-position: -10px center;
background-position: 100px 50px;
/* 百分比表示*/
background-position: 75% 25%;
background-position: right 75%;
background-position: 100%;
/* 两个子属性*/
background-position: 100px;
/* background-position-x:100px; */
background-position-y:100px;
1.3 背景图片的固定定位
.photo {
height:900px;
background-position:center;
background-repeat: no-repeat;
background-attachment: fixed;
}
1.4 背景的复合属性
background: right 200px #009 url( ) no-repeat;
标签:repeat,center,样式,背景,100px,right,background,position
From: https://www.cnblogs.com/chichi0002/p/17204638.html