写在中,在
div{
width: 1000px;
height: 1000px;
/背景颜色 : 十六进制,颜色名,rgb,rgba/
/* background-color: rgba(255, 0, 0,0.5); /
/背景图片/
/ background-image: url(“image/小红01.jpg”); /
/背景平铺:默认repeat,全重复/
/ background-repeat: repeat-x;
background-repeat: repeat-y;
background-repeat: no-repeat;
background-repeat: repeat; /
/背景大小/
/
x,y 可以写像素,可以写背景百分比。
如果想直接拉伸可以直接写cover。
/
/ background-size: 100px,100px; /
/背景定位/
/ background-position: 100px,100px; /
/复合写法/
/background 颜色,图片,定位,平铺/
/ background: coral url(“image/小红01.jpg”) repeat-x; */
/颜色渐变/
background: -webkit-linear-gradient(top,white,yellow,red);
}
来源:CSDN
作者:许润清
链接:https://blog.csdn.net/weixin_42174516/article/details/103928141