在要添加的button上加一个class 或者id
css样式如下:
.button:active {
/*background: #8C0000;*/
border-top: 1px solid #9cc;
background: #9cc;
box-shadow: 0px 1px 1px #9cc inset, 1px 0px 1px #9cc inset;
}
.button{
background:#C4C4C4;
border-top:0px solid #9cc;
border-right:1px solid #C4C4C4;
border-bottom:1px solid #C4C4C4;
border-left:1px solid #C4C4C4;
width:160px;
font-size:10pt;
text-align:center;
}
鼠标停留,离开样式
$('.user').hover(
function() {
$(this).stop().fadeTo('slow', 0.3);
},
function() {
$(this).stop().fadeTo('slow', 1);
});
推荐一个不错的网站 http://www.36ria.com/
demo/hover/demo.html