在移动鼠标之前,阴影不会消失

时间:2011-12-31 02:20:17

标签: css css3

我有一个按钮的CSS:

login #submit, .grey_part_right1 #submit, .button99{        
background: #9dd53a; /* Old browsers */
background: -moz-linear-gradient(top,  #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9dd53a), color-stop(50%,#a1d54f), color-stop(51%,#80c217), color-stop(100%,#7cbc0a)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* IE10+ */
background: linear-gradient(top,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9dd53a', endColorstr='#7cbc0a',GradientType=0 ); /* IE6-9 */
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px; 
text-shadow: 0 1px 0 rgba(0,0,0,.5);
-webkit-box-shadow: 0 8px 6px -6px #666;
-moz-box-shadow: 0 8px 6px -6px #666;
box-shadow: 0 8px 6px -6px #666;  
border: 1px solid #48922c;
float: left;
height: 30px;
padding: 0;
padding-bottom:4px;
width: 100px;
cursor: pointer;
font: bold 13px "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fff;
    }

当用户点击按钮时,我希望阴影移动,然后向下移动按钮2px,从而创建“真正的”按钮效果。所以我有class = button99的按钮并添加以下内容:

 .button99:active {
margin-top:2px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none 
}

但是在鼠标按钮仍然向下移动鼠标之前,阴影不会消失......

为什么它没有立即消失的任何想法?

1 个答案:

答案 0 :(得分:1)

检查this

定义:将鼠标悬停为单独的定义。这是你想要的吗?