我试图让我的页面上的标题从白色动画,通过彩虹,然后回到白色。这是我的代码:
CSS:
@-webkit-keyframes rainbowGlow {
from {
background-color: whitesmoke;
}
13% {
background-color: red;
}
25% {
background-color: orange;
}
38% {
background-color: yellow;
}
50% {
background-color: green;
}
63% {
background-color: blue;
}
75% {
background-color: indigo;
}
88% {
background-color: violet;
}
to {
background-color: white;
}
}
@-moz-keyframes rainbowGlow {
from {
background-color: whitesmoke;
}
13% {
background-color: red;
}
25% {
background-color: orange;
}
38% {
background-color: yellow;
}
50% {
background-color: green;
}
63% {
background-color: blue;
}
75% {
background-color: indigo;
}
88% {
background-color: violet;
}
to {
background-color: white;
}
}
@-o-keyframes rainbowGlow {
from {
background-color: whitesmoke;
}
13% {
background-color: red;
}
25% {
background-color: orange;
}
38% {
background-color: yellow;
}
50% {
background-color: green;
}
63% {
background-color: blue;
}
75% {
background-color: indigo;
}
88% {
background-color: violet;
}
to {
background-color: white;
}
}
@keyframes rainbowGlow {
from {
background-color: whitesmoke;
}
13% {
background-color: red;
}
25% {
background-color: orange;
}
38% {
background-color: yellow;
}
50% {
background-color: green;
}
63% {
background-color: blue;
}
75% {
background-color: indigo;
}
88% {
background-color: violet;
}
to {
background-color: white;
}
}
.WhiteRainbowGlow {
color: white;
font-size: 2em;
font-family: 'Segoe UI Light', Candara, Consolas, Calibri, sans-serif !important;
text-shadow: 4px 3px 6px #000000;
text-shadow: 4px 3px 6px rgba(0, 0, 0, .5);
display: inline;
padding-right: 10px;
animation-name: rainbowGlow;
animation-duration: 1s;
animation-delay: 1s;
}
HTML:
<h1 class="WhiteRainbowGlow">My Next Winner</h1>
我是不是忘记了什么?做错了什么?