您现在的位置是:首页 > 前端 > css网站首页css

CSS3酷狗音乐的动态效果

  • 袁志蒙
  • 2016-08-13 16:15:26
  • 3820 次阅读
分享一例CSS3做的酷狗音乐的动态效果.

分享一例CSS3做的酷狗音乐的动态效果.

CSS3酷狗音乐的动态效果


<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>CSS3酷狗音乐的动态效果</title>
		<style>
			*{
				margin: 0;
				padding: 0;
				box-sizing: border-box;
			}
			body{
				background: #ccc;
			}
			.box{
				margin: 150px auto;
				width: 174px;
				height: 100px;
				background: #000;
				overflow: hidden;
			}
			.box > div{
				margin-right: 6px;
				width: 30px;
				height: 100px;
				background: #FF7F50;
				float: left;
				-webkit-animation-name: move;
				animation-name: move;
				-webkit-animation-iteration-count: infinite;
				animation-iteration-count: infinite;
				
				-webkit-animation-duration: .5s;
				animation-duration: .5s;
			}
			.box > div:last-child{
				margin-right: 0;
			}
			.one{
				-webkit-animation-delay: .2s;
				animation-delay: .2s;
			}
			.two{
				-webkit-animation-delay: .3s;
				animation-delay: .3s;
			}
			.three{
				-webkit-animation-delay: .4s;
				animation-delay: .4s;
			}
			.four{
				-webkit-animation-delay: .5s;
				animation-delay: .5s;
			}
			.five{
				-webkit-animation-delay: .6s;
				animation-delay: .6s;
			}
			@keyframes move{
				0{
					-webkit-transform: translateY(0);
					transform: translateY(0);
				}
				50%{
					-webkit-transform: translateY(100px);
					transform: translateY(100px);
				}
				100%{
					-webkit-transform: translateY(0);
					transform: translateY(0);
				}
			}
			@-webkit-keyframes move{
				0{
					-webkit-transform: translateY(0);
					transform: translateY(0);
				}
				50%{
					-webkit-transform: translateY(100px);
					transform: translateY(100px);
				}
				100%{
					-webkit-transform: translateY(0);
					transform: translateY(0);
				}
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="one"></div>
			<div class="two"></div>
			<div class="three"></div>
			<div class="four"></div>
			<div class="five"></div>
		</div>
	</body>
</html>
TAG: css

文章评论 (0)

    • 这篇文章还没有收到评论,赶紧来抢沙发吧~


Top