Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
css中自动隐藏div问题_Css - Fatal编程技术网

css中自动隐藏div问题

css中自动隐藏div问题,css,Css,我试图在10s之后显示div 它获得了成功,但它也自动隐藏 我不想把它藏起来 我尝试过:删除不透明度:0从类元素到动画 .element-to-animate { -webkit-animation: NAME-YOUR-ANIMATION 10s forwards; -moz-animation: NAME-YOUR-ANIMATION 10s forwards; -o-animation: NAME-YOUR-ANIMATION 10s forwards;

我试图在10s之后显示
div

它获得了成功,但它也自动隐藏

我不想把它藏起来


我尝试过:

删除
不透明度:0从类
元素到动画

    .element-to-animate {
    -webkit-animation: NAME-YOUR-ANIMATION 10s forwards;
    -moz-animation: NAME-YOUR-ANIMATION 10s forwards;
    -o-animation: NAME-YOUR-ANIMATION 10s forwards;
    animation: NAME-YOUR-ANIMATION 10s forwards;
    opacity:0;
}
新代码:

.element-to-animate {
    -webkit-animation: NAME-YOUR-ANIMATION 10s;
    -moz-animation: NAME-YOUR-ANIMATION 10s;
    -o-animation: NAME-YOUR-ANIMATION 10s;
    animation: NAME-YOUR-ANIMATION 10s;
}

你有一个动画,每个动画都有一个间隔。 如果你想让这个循环成为你必须设置的动画

 animation-iteration-count: 1;

将所有关键帧中的不透明度值从0到1替换为100%。

并在类
中添加
动画填充模式:转发
属性以设置动画

    .element-to-animate {
    -webkit-animation: NAME-YOUR-ANIMATION 10s forwards;
    -moz-animation: NAME-YOUR-ANIMATION 10s forwards;
    -o-animation: NAME-YOUR-ANIMATION 10s forwards;
    animation: NAME-YOUR-ANIMATION 10s forwards;
    opacity:0;
}

请在这里粘贴代码。你的关键帧都有100%的不透明度0。