讲给Android程序员看的前端系列教程(40集免费视频教程+源码)
版权声明
- 本文原创作者:谷哥的小弟
- 作者博客地址:http://blog.csdn.net/lfdfhl
轮播图
在本节教程中,我们介绍Bootstrap提供的轮播图及其样式。
<!DOCTYPE html>
<!-- 本文作者:谷哥的小弟-->
<!-- 博客地址:https://blog.csdn.net/lfdfhl-->
<html>
<head>
<!-- 以下3个meta标签必须置于head标签的最前位置 -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>轮播图</title>
<!-- 引入Bootstrap的css文件 -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- 引入jQuery文件 -->
<script src="js/jquery-3.2.1.min.js"></script>
<!-- 引入Bootstrap的JavaScript -->
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="img/autumn1.jpg" alt="秋天">
<div class="carousel-caption">
秋天
</div>
</div>
<div class="item">
<img src="img/autumn2.jpg" alt="初秋">
<div class="carousel-caption">
初秋
</div>
</div>
<div class="item">
<img src="img/autumn3.jpg" alt="深秋">
<div class="carousel-caption">
深秋
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</body>
</html>