全屏切换案例

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			*{
				padding: 0;
				margin: 0;
			}
			html,body{
				overflow: hidden;
				height: 100%;
			}
			.pic{
				width: 100%;
				height: 100%;
				position: relative;
				z-index: 0;
			}
			.pic li{
				position: absolute;
				left: 0;
				top: 0;
				width: 100%;
				height: 100%;
				background-size: 100% 100%;
			}
			.pic li:nth-child(1){
				background: url(images/bg1.jpg);
			}
			.pic li:nth-child(2){
				background: url(images/bg2.jpg);
			}
			.pic li:nth-child(3){
				background: url(images/bg3.jpg);
			}
			.btn{
				position: absolute;
				left: 50%;
				margin-left: -100px;
				bottom: 20px;
				z-index: 1;
				width: 240px;
			}
			.btn li{
				width: 60px;
				height: 60px;
				margin-right: 20px;
				float: left;
				list-style: none;
			}
			li a{
				width: 60px;
				height: 60px;
				line-height: 60px;
				text-align: center;
				font-size: 20px;
				background: red;
				color: #000;
				display: block;
				text-decoration: none;
				border-radius: 50%;
			}
			.pic li:target{
				z-index: 99;
			}
			.pic li:nth-child(1):target{
				animation: move 1s;
			}
			.pic li:nth-child(2):target{
				animation: run 1s;
			}
			.pic li:nth-child(3):target{
				animation: go 1s;
			}
			@keyframes move{
				from{
					transform: translateX(-2000px);
				}
				to{
					transform: translateX(0px);
				}
			}
			@keyframes run{
				from{
					transform: scale(0.7);
				}
				to{
					transform: scale(1);
				}
			}
			@keyframes go{
				from{
					transform: rotate(0deg);
				}
				to{
					transform: rotate(360deg);
				}
			}
		</style>
	</head>
	<body>
		<ul class="pic">
			<li id="t1"></li>
			<li id="t2"></li>
			<li id="t3"></li>
		</ul>
		<ul class="btn">
			<li>
				<a href="#t1">1</a>
			</li>
			<li>
				<a href="#t2">2</a>
			</li>
			<li>
				<a href="#t3">3</a>
			</li>
		</ul>
	</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值