目录
1.背景颜色![](https://i-blog.csdnimg.cn/blog_migrate/7462f5efaf50bff594fcb2135ea74152.png)
2.背景图片
3.背景平铺
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>背景平铺</title>
<style>
div {
width: 300px;
height: 300px;
background-image: url(/image/1.jpg);
/* 1.背景图片不平铺
background-repeat: no-repeat; */
/* 2.默认情况下背景图片是平铺的
background-repeat: repeat; */
/* 3.沿x,y轴平铺
background-repeat: repeat-x;
background-repeat: repeat-y; */
}
</style>
</head>
<body>
<div></div>
</body>
</html>
4.背景图片位置
5.背景图片固定
6.背景复合写法
7.背景半透明色