background-color 设置背景 “颜色”
.box{
background-color:transparent ;
background-color:#00C853;
background-color:inherit ;
}
background-image 设置背景 “图片”
.box{
background-image:none ;
background-image:url('URL') ;
background-image:linear-gradient(to bottom,#76FF03 0%,#00E676 50%,#00C853 100%);
background-image:linear-gradient(to left top,#76FF03 0%,#00E676 50%,#00C853 100%);
background-image:linear-gradient(45deg,#76FF03 0%,#00E676 50%,#00C853 100%);
}
background-repeat 设置背景图片 “是否重复”
.box{
background-repeat: repeat ;
background-repeat: repeat-x ;
background-repeat: repeat-y ;
background-repeat: no-repeat ;
background-repeat: inherit ;
}
background-size设置背景图片的“大小”
.box{
background-size:100% 100%;
background-size:100%;
background-size:cover ;
background-size: contain ;
}
background-attachment 设置背景图片 “是否跟随窗口滚动”
.box{
background-attachment: scroll;
background-attachment: fixed;
background-attachment: local ;
background-attachment: initial;
background-attachment: inherit;
}
background-position 设置背景图片在“元素中的位置”
.box{
background-position:left top ;
background-position:20% 30%;
background-position:inherit ;
}
background-origin设置 “background-position”相对于什么位置来定位背景图片
.box{
background-origin:padding-box ;
background-origin:border-box;
background-origin:content-box ;
}
background-clip设置 背景图片的显示区域
.box{
background-clip:padding-box ;
background-clip:border-box;
background-clip:content-box ;
}
background 设置 背景的缩写
.box{
background:bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit;
}