此动画仅限谷歌浏览器····
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style type="text/css">
//格式的大小与循环移动改变颜色
.myfirst{
height: 200px;
background:red;
width: 200px;
position:relative;
-webkit-animation: myfirst 5s linear 0s infinite alternate;
}
//颜色与位置的变化
@-webkit-keyframes myfirst /* Safari and Chrome */
{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:500px; top:500px;}
75% {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
</style>
<body>
<div class="myfirst"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style type="text/css">
//格式的大小与循环移动改变颜色
.myfirst{
height: 200px;
background:red;
width: 200px;
position:relative;
-webkit-animation: myfirst 5s linear 0s infinite alternate;
}
//颜色与位置的变化
@-webkit-keyframes myfirst /* Safari and Chrome */
{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:500px; top:500px;}
75% {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
</style>
<body>
<div class="myfirst"></div>
</body>
</html>
本文展示了如何使用CSS在谷歌浏览器中创建动态动画效果,通过设置样式、关键帧动画和循环移动,实现颜色与位置的变化。
1958

被折叠的 条评论
为什么被折叠?



