gpt4 book ai didi

CSS3 动画 : Can I leave out the "to" values?

转载 作者:行者123 更新时间:2023-11-28 15:29:45 25 4
gpt4 key购买 nike

我的代码目前看起来像这样:

@keyframes lfade {
from {
opacity: 0;
margin-left: 45px;
}

to {
opacity: 1;
margin-left: 0px; //this line
}
}

我能否删除 to block 中的 margin-left 行,以便浏览器使用我尝试设置动画的对象的默认边距而不是 0px?
它似乎适用于 Firefox 和 Opera,但我找不到任何官方资源。

最佳答案

是的,你可以,但首先你必须指定你正在制作动画的样式表中的原始边距,然后再像这样取出它:

    #tag { width: 200; margin-left:45;}//you just do what you know overthere

然后设置你的动画标签

       @keyframes lfade {
from {
opacity: 0;
margin-left: 45px;
}

to {
opacity: 1;
margin-left: 0px; //this line
}
}

试试这个

关于CSS3 动画 : Can I leave out the "to" values?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22424886/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com