<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style type="text/css">
@keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
@-webkit-keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
@-moz-keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
@-ms-keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
@keyframes move-clouds-back {
from {
background-position: 0 0;
}
to {
background-position: 10000px 0;
}
}
@-webkit-keyframes move-clouds-back {
from {
background-position: 0 0;
}
to {
background-position: 10000px 0;
}
}
@-moz-keyframes move-clouds-back {
from {
background-position: 0 0;
}
to {
background-position: 10000px 0;
}
}
@-ms-keyframes move-clouds-back {
from {
background-position: 0;
}
to {
background-position: 10000px 0;
}
}
.stars,
.twinkling,
.clouds {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
display: block;
}
.stars {
background: #000 url(img/stars.png) repeat top center;
z-index: 0;
}
.twinkling {
background: transparent url(img/twinkling.png) repeat top center;
z-index: 1;
-moz-animation: move-twink-back 200s linear infinite;
-ms-animation: move-twink-back 200s linear infinite;
-o-animation: move-twink-back 200s linear infinite;
-webkit-animation: move-twink-back 200s linear infinite;
animation: move-twink-back 200s linear infinite;
}
.clouds {
background: transparent url(img/clouds.png) repeat top center;
z-index: 3;
-moz-animation: move-clouds-back 200s linear infinite;
-ms-animation: move-clouds-back 200s linear infinite;
-o-animation: move-clouds-back 200s linear infinite;
-webkit-animation: move-clouds-back 200s linear infinite;
animation: move-clouds-back 200s linear infinite;
}
/********/
@-webkit-keyframes flash {
0% {
color: #ff0000;
}
20% {
color: #0000FF;
}
40% {
color: #ff00FF;
}
60% {
color: #ff0000;
}
80% {
color: #0000FF;
}
100% {
color: #ff00FF;
}
}
@keyframes flash {
0% {
color: #ff0000;
}
20% {
color: #0000FF;
}
40% {
color: #ff00FF;
}
60% {
color: #ff0000;
}
80% {
color: #0000FF;
}
100% {
color: #ff00FF;
}
}
.flash {
position: relative;
font-size: -webkit-xxx-large;
color: #0000ff;
width: 100%;
margin: 20% auto 0;
text-align: center;
z-index: 999;
font-family:cursive;
font-weight: bolder;
-webkit-animation: flash 1.5s infinite cubic-bezier(1, 0, 0.5, 0);
}
</style>
<body>
<div class="stars"></div>
<div class="twinkling"></div>
<div class="clouds"></div>
<div class="flash">闪烁闪烁的小星星</div>
</body>
</html>
网友评论