<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>雪碧图</title>
<style type="text/css">
.box1:link{
display: block;
width: 93px;
height: 25px;
background-image: url(./btn/btn.png);
background-repeat: no-repeat;
}
.box1:hover{
background-position: -93px 0px;
}
.box1:active{
background-position: -186px px;
}
</style>
</head>
<body>
<a href="#" class="box1"></a>
</body>
</html>
代码效果
鼠标悬停时:
鼠标点击后: