首页 > 代码库 > 使用boostrap实现图片轮播
使用boostrap实现图片轮播
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>图片轮播</title> <link rel="stylesheet" href="http://www.mamicode.com/css/index.css"> <link rel="stylesheet" href="http://www.mamicode.com/css/bootstrap.min.css"> <style type="text/css" > #myCarousel{ width:700px; height:454px; margin: 0 auto; } .carousel-inner{ position:relative; } #num{ position:absolute; top:380px; left:300px; } </style> </head> <body> <div id="myCarousel" class="carousel slide"> <!-- 轮播(Carousel)项目 --> <div class="carousel-inner"> <div class="item active"> <img src="http://www.mamicode.com/images/adver01.jpg" alt="First slide"> </div> <div class="item"> <img src="http://www.mamicode.com/images/adver02.jpg" alt="Second slide"> </div> <div class="item"> <img src="http://www.mamicode.com/images/adver03.jpg" alt="Third slide"> </div> <div class="item"> <img src="http://www.mamicode.com/images/adver04.jpg" alt="Fourth slide"> </div> <div class="item"> <img src="http://www.mamicode.com/images/adver05.jpg" alt="Fifth slide"> </div> <div class="item"> <img src="http://www.mamicode.com/images/adver06.jpg" alt="Sixth slide"> </div> </div> <!-- 轮播(Carousel)指标 --> <ul class="carousel-indicators" id="num"> <li data-target="#myCarousel" data-slide-to="0" class="active">1</li> <li data-target="#myCarousel" data-slide-to="1">2</li> <li data-target="#myCarousel" data-slide-to="2">3</li> <li data-target="#myCarousel" data-slide-to="3">4</li> <li data-target="#myCarousel" data-slide-to="4">5</li> <li data-target="#myCarousel" data-slide-to="5">6</li> </ul> <!-- 轮播(Carousel)导航 --> <a class="carousel-control left" href="http://www.mamicode.com/#myCarousel" data-slide="prev">‹ </a> <a class="carousel-control right" href="http://www.mamicode.com/#myCarousel" data-slide="next">› </a> </div> <script src="http://www.mamicode.com/js/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="http://www.mamicode.com/js/bootstrap.min.js"></script> <script type="text/javascript"> </script> </body> </html>
使用boostrap实现图片轮播
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。