bootstrap实现图片轮播效果

  • Post author:
  • Post category:其他


<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>设计轮播图效果</title>
    <meta name="viewport" content="width=device-width,initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="bootstrap-4.5.3-dist/css/bootstrap.css">
    <script src="jquery-3.5.1.slim.js"></script>
    <script src="bootstrap-4.5.3-dist/js/bootstrap.min.js"></script>
</head>
<body>
<div id="Carousel" class="carousel slide" data-ride="carousel">
    <!--标识图标-->
    <ol class="carousel-indicators">
        <li data-target="#Carousel" data-slide-to="0" class="active"></li>
        <li data-target="#Carousel" data-slide-to="1"></li>
        <li data-target="#Carousel" data-slide-to="2"></li>
    </ol>
    <!--幻灯片-->
    <div class="carousel-inner">
        <div class="carousel-item active">
            <img src="images/1.jpg" class="d-block w-100" alt="">
            <div class="carousel-caption">
                <h5>设计轮播图效果</h5>
                <p>说明文字</p>
            </div>
        </div>
        <div class="carousel-item">
            <img src="images/2.jpg" class="d-block w-100" alt="">
            <div class="carousel-caption">
                <h5>设计轮播图效果</h5>
                <p>说明文字</p>
            </div>
        </div>
        <div class="carousel-item">
            <img src="images/3.jpg" class="d-block w-100" alt="">
            <div class="carousel-caption">
                <h5>设计轮播图效果</h5>
                <p>说明文字</p>
            </div>
        </div>
    </div>
    <!--控制按钮-->
    <a class="carousel-control-prev" href="#Carousel" data-slide="prev">
        <span class="carousel-control-prev-icon"></span>
    </a>
    <a class="carousel-control-next" href="#Carousel" data-slide="next">
        <span class="carousel-control-next-icon"></span>
    </a>
</div>
</body>
</html>
</body>
</html>



版权声明:本文为weixin_62190821原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。