bootstrap轮播图代码
时间: 2023-07-09 14:26:10 浏览: 82
以下是一个简单的 Bootstrap 轮播图代码示例:
```html
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="image1.jpg" alt="Image 1">
<div class="carousel-caption">
<h3>Image 1</h3>
<p>Description for Image 1</p>
</div>
</div>
<div class="item">
<img src="image2.jpg" alt="Image 2">
<div class="carousel-caption">
<h3>Image 2</h3>
<p>Description for Image 2</p>
</div>
</div>
<div class="item">
<img src="image3.jpg" alt="Image 3">
<div class="carousel-caption">
<h3>Image 3</h3>
<p>Description for Image 3</p>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
```
你可以将图片和描述替换为你自己的内容,然后将代码放入你的 HTML 文件中即可。
阅读全文