简单教程
提交运行
代码编辑器:
<!DOCTYPE htm> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <style>body {margin:20px}</style> <div id="myCarousel" class="carousel slide"> <!-- 轮播 ( carousel) 指标 --> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> <li data-target="#myCarousel" data-slide-to="3"></li> <li data-target="#myCarousel" data-slide-to="4"></li> <li data-target="#myCarousel" data-slide-to="5"></li> </ol> <!-- 轮播 ( carousel ) 项目 --> <div class="carousel-inner"> <div class="item active"> <img src="/static/i/img1.jpg"> <div class="carousel-caption">图片说明 1</div> </div> <div class="item"> <img src="/static/i/img2.jpg"> <div class="carousel-caption">图片说明 2</div> </div> <div class="item"> <img src="/static/i/img3.jpg"> <div class="carousel-caption">图片说明 3</div> </div> <div class="item"> <img src="/static/i/img4.jpg"> <div class="carousel-caption">图片说明 4</div> </div> <div class="item"> <img src="/static/i/img5.jpg"> <div class="carousel-caption">图片说明 5</div> </div> <div class="item"> <img src="/static/i/img6.jpg"> <div class="carousel-caption">图片说明 6</div> </div> </div> <!-- 轮播(Carousel)导航 --> <a class="carousel-control left" href="#myCarousel" data-slide="prev">‹ </a> <a class="carousel-control right" href="#myCarousel" data-slide="next">› </a> </div> <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
运行结果: