精灵图的使用(HTML、CSS)

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>精灵图的使用</title>
<style>
.box1 {
width: 217px;
height: 130px;
margin: 100px auto;
background: url(sprites.png) no-repeat -1px -220px;
/* background-position: -182px 0; */
}

.box2 {
width: 16px;
height: 18px;
background: url(sprites.png) no-repeat -141px -38px;
background-color: #a4a4a4;
margin: 300px auto;
}
</style>
</head>

<body>
<div class="box1"></div>
<div class="box2"></div>
</body>

</html>