您的位置:首页 > Web前端 > HTML5

html5中点击按钮,改变按钮状态效果样式

2013-06-24 12:00 363 查看
在要添加的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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html5 css