編碼的世界 / 優質文選 / 生涯

CSS隱藏元素,5秒後顯示


2022年5月14日
-   

參見英文答案 >
CSS Auto hide elements after 5 seconds                                    4個
我需要知道如何做到這一點.
基本上:
-Page加載元素隱藏
– 等了5秒
-Show元素
我對CSS不是很好,所以任何幫助都會很好!
#thingtohide {
-moz-animation: cssAnimation 0s ease-in 5s forwards;
/* Firefox */
-webkit-animation: cssAnimation 0s ease-in 5s forwards;
/* Safari and Chrome */
-o-animation: cssAnimation 0s ease-in 5s forwards;
/* Opera */
animation: cssAnimation 0s ease-in 5s forwards;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
@keyframes cssAnimation {
to {
width:0;
height:0;
overflow:hidden;
}
}
@-webkit-keyframes cssAnimation {
to {
width:0;
height:0;
visibility:hidden;
}
}

熱門文章