我试图通过css中的关键帧和动画将最小化/最大化效果应用于div.虽然简单的,非动画的效果本身很简单(我已经添加了它),但对于关键帧的起点(来自{...})的需求让我很生气!我已经尝试过使用空的属性,使用虚拟的非相关属性(如不透明度:1,不需要不透明度)或使用所需属性的自动值,但到目前为止我没有运气.所以我的问题是,有没有办法设置一个关键帧,所以它从div的当前属性值开始?更具体地说,我可以将div的宽度和高度从它的CURRENT,generic,width和height开始扩展到给定的大小吗?
到目前为止我的代码(效果相关代码):
@-webkit-keyframes maxWin{
from
{
/* width: auto; or width: ; or nothing at all */
/* height: auto; or height: ; or nothing at all */
/* left: auto; or left: ; or nothing at all */
/* top: auto; or top: ; ...you know. */
}
to
{
width: 100% !important;
height: 100% !important;
left: 0px !important;
top: 0px !important;
}
}
@-webkit-keyframes minWin
{
from
{
/*width: auto; or width: ;*/
/*height: auto; or height: ;*/ …Run Code Online (Sandbox Code Playgroud)