CSS3动画相册制作

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			html,body{
				height: 100%;
				background: pink;
			}
			section img{
				display: block;
				width: 100%;
				height: 100%;
				position: fixed;
				left: 0;right: 0;
				top: 0;bottom: 0;
				margin:auto;
				transition: 1s;
				opacity: 0;
				background: pink;
			}
			#btnBox{
				width: 700px;
				height: 140px;
				position: fixed;
				/* 3个值,第一个是上,第二个是左右,第三个是下 */
				margin:auto auto 0;
				z-index: 10;
			}
			#btnBox a{
				width: 120px;
				height: 120px;
				float: left;
				border: 10px solid #fff;
				border-radius: 70px;
			}
			#btnBox a:nth-child(1){
				background: url(img/1.jpg) no-repeat center;
				background-size: 100% 100%;
			}
			#btnBox a:nth-child(2){
				background: url(img/2.jpg) no-repeat center;
				background-size: 100% 100%;
			}
			#btnBox a:nth-child(3){
				background: url(img/3.jpg) no-repeat center;
				background-size: 100% 100%;
			}
			#btnBox a:nth-child(4){
				background: url(img/4.jpg) no-repeat center;
				background-size: 100% 100%;
			}
			#btnBox a:nth-child(5){
				background: url(img/5.jpg) no-repeat center;
				background-size: 100% 100%;
			}
			
			section img:nth-child(1){
				transform: translateX(-100%);
			}
			section img:nth-child(1):target{
				opacity:1;
				transform: translateX(0);
			}
			
			section img:nth-child(2){
				transform: translateY(-100%);
			}
			section img:nth-child(2):target{
				opacity:1;
				transform: translateY(0);
			}
			
			section img:nth-child(3){
				transform: scale(0) ;
			}
			section img:nth-child(3):target{
				transform: scale(1) rotate(360deg);
				opacity: 1;
			}
			
			section img:nth-child(4){
				transform: scale(0);
			}
			section img:nth-child(4):target{
				transform: scale(1);
				opacity: 1;
			}
			
			section img:nth-child(5){
				transform: scale(0);
			}
			section img:nth-child(5):target{
				transform: scale(1);
				opacity: 1;
			}
			
			
		</style>
	</head>
	<body>
		<section>
			<img id="im1" src="img/1.jpg" />
			<img id="im2" src="img/2.jpg" />
			<img id="im3" src="img/3.jpg" />
			<img id="im4" src="img/4.jpg" />
			<img id="im5" src="img/5.jpg" />
		</section>
		<div id="btnBox">
			<a href="#im1"></a>
			<a href="#im2"></a>
			<a href="#im3"></a>
			<a href="#im4"></a>
			<a href="#im5"></a>
		</div>
	</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值