简体   繁体   English

CSS - 使用关键帧 animation 移除框阴影

[英]CSS - remove box shadow with keyframes animation

I have an icon that initially has a box shadow set.我有一个图标,最初有一个盒子阴影集。 I am animating the icon and scaling it, but I would also like to remove the shadow while I am doing it.我正在为图标设置动画并对其进行缩放,但我也想在执行此操作时移除阴影。 I have tried it like this:我试过这样:

.loading-icon { 
    width: 80px;
    height: 80px;
    animation-name: earth;
    animation-timing-function: ease-in-out;
    animation-duration: 3s;
}
@keyframes earth {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.5) { box-shadow: none; };
    }
}

But, this is not working, how can I do that?但是,这不起作用,我该怎么做?

In keyframes you've extra {} surrounding box-shadow which is not needed.在关键帧中,您有额外的{}环绕box-shadow ,这是不需要的。

@keyframes earth {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.5);
        box-shadow: none;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM