<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
div{
width: 794px;
height: 1090px;
padding: 30px;
border: 20px groove rgba(202,227, 178, 0.6);
background-image: url(./sc16.png),url(./sc17.png),url(./sc5.png),url(./sc18.png);
background-repeat: no-repeat,no-repeat,repeat,repeat;
background-position: left top,right bottom;
/* background-clip: border-box,border-box,border-box; */
background-origin:border-box,border-box,border-box ;
}
</style>
<body>
<div>
</div>
</body>
</html>
background-origin属性值:
padding-box 从padding开始定位
border-box 从边框线开始定位
content-box 从内容开始定位
运行结果:
background-clip 有裁剪意思
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
div{
width: 794px;
height: 1090px;
padding: 30px;
border: 20px groove rgba(202,227, 178, 0.6);
background-image: url(./sc16.png),url(./sc17.png),url(./sc5.png),url(./sc18.png);
background-repeat: no-repeat,no-repeat,repeat,repeat;
background-position: left top,right bottom;
background-clip: border-box,border-box,border-box;
/* background-origin:border-box,border-box,border-box ; */
}
</style>
<body>
<div>
</div>
</body>
</html>
运行结果:
background-position 属性设置背景图像的起始位置。
background-position: left top,right bottom;