css3 - transition屬性當(dāng)鼠標(biāo)一開的時候設(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屬性如上,鼠標(biāo)離開時,陰影瞬間消失怎么辦
問題解答
回答1:transition寫在上面,不要寫在偽類后面
回答2:1.transition寫在元素上而不是偽類上2.元素上要有一個transform的初始值
回答3:這些屬性本來不用偽類可以自行執(zhí)行,transition 你得放在要過渡的元素上面
相關(guān)文章:
1. css - 關(guān)于偽類背景問題2. html - 移動端radio無法選中3. apache - 怎么給localhost后面默認(rèn)加上8080端口4. html5 - 如何實(shí)現(xiàn)圖中的刻度漸變效果?5. windows-7 - Win7中Vmware Workstatoin與Xampp中Apache服務(wù)器端口沖突?6. mysql - 數(shù)據(jù)庫建字段,默認(rèn)值空和empty string有什么區(qū)別 1107. python - 用scrapy-splash爬取網(wǎng)站 為啥iframe下的內(nèi)容沒有被返回8. 關(guān)于Navicat連接到mysql,我改了root的密碼后,Navicat連接報錯1862?9. mysql起不來了,為什么?10. mysql里show full processlist,進(jìn)程很少
