CSS Sprites(按钮)有三种不同的状态:
目前"标准","悬停"和"按下"工作.问题是,"按下"仅在按住鼠标时保持按下状态.我希望"按下"或"活动"状态保持活动状态,直到再次单击它为止.有任何想法吗?CSS解决方案?JavaScript解决方案?
谢谢你的帮助,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>
Run Code Online (Sandbox Code Playgroud)