代码语言:javascript复制
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="css/reset.css"/>
<style type="text/css">
div{
width: 500px;
height: 500px;
border:1px solid red;
background-image:url(images/king1.jpg);
background-repeat: no-repeat;
}
.box1{
background-position: right bottom;
}
.box2{
background-position: right 50px bottom 100px;
}
.box3{
background-position: left -50px top -100px;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
</body>
</html>