html 代码
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- 小圆点 -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
<li data-target="#carousel-example-generic" data-slide-to="4"></li>
</ol>
<!-- 图片 -->
<div class="carousel-inner">
<div class="item active">
<img src="img/imgaa.jpg" alt="1 slide">
</div>
<div class="item">
<img src="img/imgbb.jpg" alt="2 slide">
</div>
<div class="item">
<img src="img/imgcc.jpg" alt="3 slide">
</div>
<div class="item">
<img src="img/imgdd.jpg" alt="4 slide">
</div
<div class="item">
<img src="img/imgee.jpg" alt="5 slide">
</div>
</div>
<!-- 左右键 -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
css代码
body{
padding: 50px;
}
.carousel{
height:400px;
background-color:#000;
}
.carousel .item{
height: 400px;
background-color: #000;
}
.carousel img{
width: 100%;
}