css图片背景

背景属性

.test {
    background-image: url('../imgage/a.png'), url('../image/b.jpg'); /*a.png高于b.jpg*/
    background-repeat: no-repeat, repeat-y; /*参数可为repeat/no-repeat/repeat-x/repeat-y/inherit*/
    background-position: 0 50%, left top; /*参数可为x%y%,参数可为left/top/center...只设置一个则第二个为center,参数可为px只有一个值另一个为50%*/
    background-size: 100%, 100%; /*参数:length|percentage|cover|contain,只设置第一个参数宽度则第二个参数高度为自动*/
    background-attachment: scroll; /*参数scroll:随页面滚动,fixed:背景图像固定*/
    background-blend-mode: normal; /*背景图片混合模式:multiply正片叠底,darken/lighten变暗/亮*/
    background-clip: content-box; /*制定背景绘制区域如(yellow,content-box),参数:border-box/padding-box/content-box*/
    background-color: transparent; /*背景色:color/transparent*/
    background-origin: content-box; /*内容框相对定位的背景图片,paddIn-box/border-box/content-box*/
}
原文地址:https://www.cnblogs.com/maoriaty/p/8352380.html