css3 - transition屬性當鼠標一開的時候設置的時間不起作用
問題描述
#last-goods{ background: url('../images/lasted-goods.jpg') no-repeat; width:100%; height:73px; overflow: hidden;}#last-goods:hover{ -webkit-box-shadow:10px 10px 20px #b7b7b7; -box-shadow:10px 10px 20px #b7b7b7; transition: 1s all linear; -webkit-transition: 1s all linear; -webkit-transform: translate3d(0, -2px, 0); -moz-transform: translate3d(0, -2px, 0); -ms-transform: translate3d(0, -2px, 0); -o-transform: translate3d(0, -2px, 0); transform: translate3d(0, -2px, 0);}
css屬性如上,鼠標離開時,陰影瞬間消失怎么辦
問題解答
回答1:transition寫在上面,不要寫在偽類后面
回答2:1.transition寫在元素上而不是偽類上2.元素上要有一個transform的初始值
回答3:這些屬性本來不用偽類可以自行執行,transition 你得放在要過渡的元素上面
相關文章:
1. 求救一下,用新版的phpstudy,數據庫過段時間會消失是什么情況?2. linux運維 - python遠程控制windows如何實現3. javascript - 從mysql獲取json數據,前端怎么處理轉換解析json類型4. django - Python error: [Errno 99] Cannot assign requested address5. android - 安卓做前端,PHP做后臺服務器 有什么需要注意的?6. python小白 關于類里面的方法獲取變量失敗的問題7. mysql - ubuntu開啟3306端口失敗,有什么辦法可以解決?8. thinkPHP5中獲取數據庫數據后默認選中下拉框的值,傳遞到后臺消失不見。有圖有代碼,希望有人幫忙9. extra沒有加載出來10. python - Scrapy如何得到原始的start_url
