您现在的位置: 首页 > 资讯 > 互联网知识 > 常用的响应式滚动轮播代码

常用的响应式滚动轮播代码

互联网知识2022-08-12 15:40:07ddcweb173
html, body { position: relative; height: 100%; } body { background: #eee; font-family: Helvetica Neue, Helvetica, Ari
Slide 1
Slide 2
Slide 3
Slide 4
Slide 5
Slide 6
Slide 7
Slide 8
Slide 9
 
 
<link href="/swiper/swiper-bundle.min.css" rel="stylesheet" /><!-- Demo styles -->
<style type="text/css">html,
      body {
        position: relative;
        height: 100%;
      }

      body {
        background: #eee;
        font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
        font-size: 14px;
        color: #000;
        margin: 0;
        padding: 0;
      }

      .swiper {
        width: 100%;
        height: 300px;
      }

      .swiper-slide {
        text-align: center;
        font-size: 18px;
        background: #fff;

        /* Center slide text vertically */
        display: -webkit-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
      }

      .swiper-slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
</style><!-- Swiper -->
<div class="swiper mySwiper">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
<div class="swiper-slide">Slide 4</div>
<div class="swiper-slide">Slide 5</div>
<div class="swiper-slide">Slide 6</div>
<div class="swiper-slide">Slide 7</div>
<div class="swiper-slide">Slide 8</div>
<div class="swiper-slide">Slide 9</div></div>
<div class="swiper-button-next">&nbsp;</div>
<div class="swiper-button-prev">&nbsp;</div></div><!-- Swiper JS --><script src="/swiper/swiper-bundle.min.js"></script><!-- Initialize Swiper --><script>
      var swiper = new Swiper(".mySwiper", {
        navigation: {
          nextEl: ".swiper-button-next",
          prevEl: ".swiper-button-prev",
        },
      });
    </script>
本文标签:
售前咨询
售后咨询
技术咨询
扫一扫

全国免费服务热线
13712877293

返回顶部