css3 - transition屬性當鼠標一開的時候設(shè)置的時間不起作用
問題描述
#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:這些屬性本來不用偽類可以自行執(zhí)行,transition 你得放在要過渡的元素上面
相關(guān)文章:
1. dockerfile - [docker build image失敗- npm install]2. mysql - 用PHPEXCEL將excel文件導(dǎo)入數(shù)據(jù)庫數(shù)據(jù)5000+條,本地數(shù)據(jù)庫正常,線上只導(dǎo)入15條,沒有報錯,哪里的問題?3. docker - 如何修改運行中容器的配置5. docker不顯示端口映射呢?6. docker-compose中volumes的問題7. angular.js - angularJs ngRoute怎么在路由傳遞空字符串及用ng-switch取得8. nignx - docker內(nèi)nginx 80端口被占用9. 為什么我ping不通我的docker容器呢???10. docker綁定了nginx端口 外部訪問不到
