1. 主页
  2. 文档
  3. swiper
  4. 2.添加HTML内容

2.添加HTML内容

2.添加HTML内容。Swiper7的默认容器是’.swiper’,Swiper6之前是’.swiper-container’。

<div class="swiper">
    <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>
    <!-- 如果需要分页器 -->
    <div class="swiper-pagination"></div>
    
    <!-- 如果需要导航按钮 -->
    <div class="swiper-button-prev"></div>
    <div class="swiper-button-next"></div>
    
    <!-- 如果需要滚动条 -->
    <div class="swiper-scrollbar"></div>
</div>
导航等组件可以放在Swiper容器之外

这篇文章对您有用吗?

我们要如何帮助您?