css3 - transition属性当鼠标一开的时候设置的时间不起作用
怪我咯
怪我咯 2017-04-17 11:54:37
[CSS3讨论组]
#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属性如上,鼠标离开时,阴影瞬间消失怎么办

怪我咯
怪我咯

走同样的路,发现不同的人生

全部回复(3)
PHPz

transition写在上面,不要写在伪类后面

巴扎黑

1.transition写在元素上而不是伪类上
2.元素上要有一个transform的初始值

巴扎黑

这些属性本来不用伪类可以自行执行,transition 你得放在要过渡的元素上面

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号