【Web】CSS(No.26)定位经典案例(一)《静态轮播图》

【Web】CSS(No.26)定位经典案例(一)《静态轮播图》
需要素材点击图片联系我或私信、评论

效果图:

【Web】CSS(No.26)定位经典案例(一)《静态轮播图》

源码:

<!DOCTYPE html>
<html lang="en">
  <head>
	<meta charset="UTF-8">
	<title>静态轮播图</title>
	<style>
	  * {
	  	margin:0;
	  	padding:0;
	  }

	  .banner {
	  	width: 520px;
	  	height: 280px;
	  	margin: 100px auto;
	  	position: relative;
	  }

	  .banner .img img {
	  	position: absolute;
	  	top:0;
	  	left:0;
	  }

	  .banner ul {
	  	width: 80px;
	  	height: 15px;
	  	position: absolute;
	  	left: 50%;
	  	margin-left: -40px;
	  	bottom: 20px;
	  	background-color: rgba(255,255,255,0.2);
	  	border-radius: 10px;
	  }

	  .banner ul li {
	  	float:left;
	  	list-style: none;
	  	width: 8px;
	  	height: 8px;
	  	border-radius: 50px;
	  	background-color: #dddddd;
	  	margin: 2px;
	  	margin:3px 4px;
	  }

	  .banner ul li:hover {
	  	background-color: darkred;
	  }

	   .banner ul li.now {
	   	background-color: darkred;
	   }

	  .banner a {
	  	color:#dddddd;
	  	text-decoration: none;
	  	position: absolute;
	  	top: 50%;
	  	margin-top:-20px;
	  	width: 30px;
	  	height: 40px;
	  	text-align: center;
	  	line-height: 40px;
	  	font-size:20px;
	  }

	  .banner a:hover {
	  	color: darkred;
	  }

	  .banner a.left {
	  	width: 45px;
	  	height: 45px;
	  	border-radius: 50px;
	  	background-color:  rgba(255,255,255,0.2);
	  	left:0;
	  }

	   .banner a.right {
	   	width: 45px;
	  	height: 45px;
	  	border-radius: 50px;
	  	background-color:  rgba(255,255,255,0.2);
	  	right:0;
	  }
	</style>
  </head>
  <body>
	<div class="banner">
	  <!-- 图片容器 -->
	  <div class="img">
	    <img src="img/tb.jpg" alt="">
	    <img src="img/taobao.jpg" alt="">
	    <img src="img/tb.jpg" alt="">
	    <img src="img/taobao.jpg" alt="">
	    <img src="img/tb.jpg" alt="">
	  </div>

	  <!-- 点容器 -->
	  <ul>
	    <li class="now"></li>
	    <li></li>
	    <li></li>
	    <li></li>
	    <li></li>
	  </ul>

	  <!-- 按钮 -->
	  <a class="left" href="#">&lt;&lt;</a>
	  <a class="right" href="#">&gt;&gt;</a>
	</div>
  </body>
</html>
上一篇:android – 无法显示AdMob横幅


下一篇:[Android] 为Android安装BusyBox —— 完整的bash shell(收藏用)