代码如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>雪碧图</title>
<style type="text/css">
.cart{
width: 40px;
height: 30px;
margin: 100px auto;
background-image: url("img/1.png");
background-position: -10px -338px;
}
a:link{
display: block;
width: 40px;
height: 30px;
}
a:hover{
background-position: -58px -338px;
}
a:active{
background-position: -130px -338px;
}
</style>
</head>
<body>
<a class="cart" href="#"></a>
</body>
</html>
网友评论