纯css label写轮播图

<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="UTF-8">
	<title>选项卡</title>
	<style type="text/css">
		*{padding: 0;margin: 0;}
		li{list-style: none}
		ul{width: 300px;height: 200px;position: relative;}
		div{width: 300px;height: 200px;position: absolute;left: 0;top: 0;display: none;}
		label{background: url(../images/banner-1-22.png) 0 0 no-repeat;display: block;height: 12px;width: 12px;z-index: 1;}
		.al1{position: absolute;left: 80%;top:80%;}
		.al2{position: absolute;left: 70%;top:80%;}
		.al3{position: absolute;left: 60%;top:80%;}
		.al4{position: absolute;left: 50%;top:80%;}
		input:checked + label{background: url(../images/banner-1-11.png) 0 0 no-repeat;}
		input:checked ~ div{display: block;}
	</style>
</head>
<body>
	<ul>
		<li>
			<input type="radio" id="a1" checked="checked" name="1">
			<label for="a1" class="al1">
			</label>
			<div class="ab1">
				<img src="../images/b1.png" alt="">
			</div>
		</li>
		<li>
			<input type="radio" id="a2" name="1">
			<label for="a2" class="al2">
			</label>
			<div class="ab2">
				<img src="../images/b2.png" alt="">
			</div>
		</li>
		<li>
			<input type="radio" id="a3" name="1">
			<label for="a3" class="al3">
			</label>
			<div class="ab3">
				<img src="../images/b3.png" alt="">
			</div>
		</li>
		<li>
			<input type="radio" id="a4" name="1">
			<label for="a4" class="al4">
			</label>
			<div class="ab4">
				<img src="../images/b4.png" alt="">
			</div>
		</li>
	</ul>
</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值