我想从按钮悬停(现在是0秒)后获得相同的时间(0.4秒)。 如果我将鼠标悬停在按钮上,则没有过渡。 悬停后花了0秒。我希望它处于悬停状态时具有0.4。
.btn_akoo {
text-transform: uppercase;
background-color:#e92741;
-moz-border-radius:30px;
-webkit-border-radius:30px;
border-radius:30px;
border:3px solid #f5f487;
display:inline-block;
cursor:pointer;
color:#2d2f3c;
font-family:Verdana;
font-size:17px;
font-weight:bold;
padding:30px 18px;
text-decoration:none;
position: relative;
margin-left: 38%;
margin-top: 18%;
}
.btn_akoo:hover {
background: #2d2f3c;
color: #e92741;
padding-left: 30px;
padding-right: 30px;
-webkit-box-shadow:0px 0px 40px 1px #f5f487 ;
-moz-box-shadow:0px 0px 40px 1px #f5f487 ;
box-shadow:0px 0px 40px 1px #f5f487 ;
transition: 0.4s ;
}
<div class="wrapper_akoo">
<a class="btn_akoo" href="#" >Ako sa zaregistrovať?</a>
</div>
答案 0 :(得分:0)
在基类中设置转换,而不是:hover状态:
.btn_akoo {
text-transform: uppercase;
background-color: #e92741;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
border: 3px solid #f5f487;
display: inline-block;
cursor: pointer;
color: #2d2f3c;
font-family: Verdana;
font-size: 17px;
font-weight: bold;
padding: 30px 18px;
text-decoration: none;
position: relative;
margin-left: 38%;
margin-top: 18%;
transition: 0.4s;
}
.btn_akoo:hover {
background: #2d2f3c;
color: #e92741;
padding-left: 30px;
padding-right: 30px;
-webkit-box-shadow: 0px 0px 40px 1px #f5f487;
-moz-box-shadow: 0px 0px 40px 1px #f5f487;
box-shadow: 0px 0px 40px 1px #f5f487;
}
<div class="wrapper_akoo">
<a class="btn_akoo" href="#">Ako sa zaregistrovať?</a>
</div>