我已將一個transition
效果添加到按鈕,但它不起作用。背景顏色是白色的;通過添加過渡效果,顏色應該從下往上移動,但不影響。這是fiddle link。這是代碼:將過渡效果添加到按鈕不起作用
.hourlypricing {
background: #57c1e8;
border: .2rem solid #57c1e8;
min-width: 16.5rem;
display: inline-block;
text-align: center;
height: 6rem;
margin-left: 265px;
line-height: 5.6rem;
text-transform: uppercase;
letter-spacing: .1em;
white-space: nowrap;
font-size: 1.4rem;
padding: 0 2.5rem;
font-weight: 700;
cursor: pointer;
text-decoration: none !important;
-webkit-transition: background-color .1s ease-in-out, color .1s ease-in-out, -webkit-box-shadow .1s ease-in-out;
transition: background-color .1s ease-in-out, color .1s ease-in-out, box-shadow .1s ease-in-out;
}
button.monthlypricing {
margin-left: 50px;
background: #fff;
border: .2rem solid #57c1e8;
min-width: 16.5rem;
display: inline-block;
text-align: center;
height: 6rem;
line-height: 5.6rem;
text-transform: uppercase;
letter-spacing: .1em;
white-space: nowrap;
font-size: 1.4rem;
padding: 0 2.5rem;
font-weight: 700;
cursor: pointer;
color: #000;
text-decoration: none !important;
-webkit-transition: background-color .1s ease-in-out, color .1s ease-in-out, -webkit-box-shadow .1s ease-in-out;
transition: background-color .1s ease-in-out, color .1s ease-in-out, box-shadow .1s ease-in-out;
}
<div class="hourly">
<button class="hourlypricing">Hourly Pricing</button>
<span class="FyfR" data-reactid="5">or</span>
<button class="monthlypricing">Monthly Pricing</button>
</div>
_When_應該轉變發生的?你沒有具體說明。 – Xufox
也許你想要動畫? –
@Xufox當用戶將鼠標懸停在每月定價上時,它應該改變背景顏色,顏色應該從下到上滑動 – user8725518