首页 > 网站 > WEB开发 > 正文

35.轮播图

2024-04-27 15:18:52
字体:
来源:转载
供稿:网友
<!doctype html><html> <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> <link rel="stylesheet" href="CSS/bootstrap.css"/> <style> #pic{ width:900px; margin:0 auto; } .carousel-caption{ color:#f00; } </style> </head> <body> <!--carousel中文译为轮播,旋转木马 slide给图片添加运动效果; data-interval是间隔时间,不能低于400否则易出问题,单位为ms即毫秒; data-ride="carousel为页面一加载就开始轮播图片 carousel-caption是在图片上放置文字--> <div class="container"> <div id="pic" class="carousel slide" data-interval="2000" data-ride="carousel"> <!--小圆点--> <ol class="carousel-indicators"> <li class="active"></li> <li></li> <li></li> <li></li> </ol> <!--轮播的图片--> <div class="carousel-inner"> <div class="item active"> <img src="images/1.jpg"/> <div class="carousel-caption"> <h4>标题1</h4> <p>xxxxxxxxxxxxxxxxxxxx</p> </div> </div> <div class="item"> <img src="images/2.jpg"/> <div class="carousel-caption"> <h4>标题2</h4> <p>xxxxxxxxxxxxxxxxxxxx</p> </div> </div> <div class="item"> <img src="images/3.jpg"/> <div class="carousel-caption"> <h4>标题3</h4> <p>xxxxxxxxxxxxxxxxxxxx</p> </div> </div> <div class="item"> <img src="images/4.jpg"/> <div class="carousel-caption"> <h4>标题4</h4> <p>xxxxxxxxxxxxxxxxxxxx</p> </div> </div> </div> <!--左右按钮--> <a href="#pic" class="carousel-control left" data-slide="PRev">&lsaquo;</a> <a href="#pic" class="carousel-control right" data-slide="next">&rsaquo;</a> </div> </div> <script src="js/jquery-2.1.0.js"></script> <script src="js/bootstrap.js"></script> </body></html>

这里写图片描述


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表