【发布时间】:2023-03-10 23:39:01
【问题描述】:
我有一些东西需要隐藏几秒钟然后出现。此代码在 Chrome 中完美运行,但在其他任何地方都无法运行。谁能告诉我如何让它在 Firefox/IE 中工作?
.titlebox .md a[href*="#nm"] {
-webkit-animation-name: hidemeforabit;
-webkit-animation-duration: 1.25s;
-webkit-animation-iteration-count: 1;
animation-name: hidemeforabit;
animation-duration: 1.25s;
animation-iteration-count: 1;
-moz-animation-name: hidemeforabit;
-moz-animation-duration: 1.25s;
-moz-animation-iteration-count: 1;
opacity: 1;
}
.titlebox .md a[href*="#dm"] {
-webkit-animation-name: hidemeforabit;
-webkit-animation-duration: 1.25s;
-webkit-animation-iteration-count: 1;
animation-name: hidemeforabit;
animation-duration: 1.25s;
animation-iteration-count: 1;
-moz-animation-name: hidemeforabit;
-moz-animation-duration: 1.25s;
-moz-animation-iteration-count: 1;
opacity: 1
}
.side .md h4:nth-of-type(1) {
-webkit-animation-name: hidemeforabit;
-webkit-animation-duration: 1.25s;
-webkit-animation-iteration-count: 1;
animation-name: hidemeforabit;
animation-duration: 1.25s;
animation-iteration-count: 1;
-moz-animation-name: hidemeforabit;
-moz-animation-duration: 1.25s;
-moz-animation-iteration-count: 1;
opacity: 1;
}
@-webkit-keyframes hidemeforabit {
from {
width: 0 !important;
height: 0 !important;
overflow: hidden !important;
visibility: hidden !important;
right: -100000px !important;
z-index: -1 !important;
display: none !important;
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes hidemeforabit {
from {
width: 0 !important;
height: 0 !important;
overflow: hidden !important;
visibility: hidden !important;
right: -100000px !important;
z-index: -1 !important;
display: none !important;
opacity: 1;
}
to {
opacity: 0;
}
}
@-moz-keyframes hidemeforabit {
from {
width: 0 !important;
height: 0 !important;
overflow: hidden !important;
visibility: hidden !important;
right: -100000px !important;
z-index: -1 !important;
display: none !important;
opacity: 1;
}
to {
opacity: 0;
}
}
【问题讨论】:
-
复制
-webkit-animation属性,删除-webkit-并将它们放在前缀属性之后。 Most browers support the native CSS property, including the latest Chrome stable -- Here is an example snippet
标签: css animation visibility