精灵图片的使用
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
div {
width: 100px;
height: 100px;
border: 1px solid red;
background-image: url(皮卡丘.jpeg);
background-size: 400%;
background-repeat: no-repeat;
}
#div1 {
/* 背景图的位置,第一个值是左右位置,第二个值是上下位置 */
background-position: 10px 0px;
}
#div2 {
/* 背景图的位置,第一个值是左右位置,第二个值是上下位置 */
background-position: -90px 0px;
}
#div3 {
/* 背景图的位置,第一个值是左右位置,第二个值是上下位置 */
background-p