使用三种不同状态的CSS Sprites(按钮):
感谢您的帮助, D
以下是代码:
- 标准
- 悬停
- 按下(活动)
感谢您的帮助, D
以下是代码:
<html>
<style type="text/css">
a.button {
background-image: url('BUTTON SPRITES IMAGE');
width: 86px;
height: 130px;
display: block;
text-indent: -9999px;
}
a.micbutton:hover {
background-position: 0 -130px;
}
a.micbutton:active {
background-position: 0 -260px;
}
</style>
<a class="button" href="#" ></a>
</html>
:hover
或:active
样式,您需要添加 JavaScript 单击事件来维护“激活”样式,并处理第二次点击以再次禁用它。 - andyb