这是我的代码:
<section 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" role=listbox>
<div class="item active">
<img src="http://localhost/gst/media/sv.jpg" alt="First slide">
<div class="carousel-caption">
<h3>125 9684</h3>
<p>awr gre</p>
</div>
</div>
<div class=item>
<img src="http://localhost/gst/media/gd.jpg" alt="Second slide">
<div class="carousel-caption">
<h3>125 9684</h3>
<p>awr gre</p>
</div>
</div>
<div class=item>
<img src="http://localhost/gst/media/bj.jpg" alt="Third slide">
<div class="carousel-caption">
<h3>125 9684</h3>
<p>awr gre</p>
</div>
</div>
</div>
<a class="left carousel-control" href=#carousel-example-generic role=button data-slide=prev>
<span class="glyphicon glyphicon-chevron-left" aria-hidden=true></span>
<span class=sr-only>Previous</span>
</a>
<a class="right carousel-control" href=#carousel-example-generic role=button data-slide=next>
<span class="glyphicon glyphicon-chevron-right" aria-hidden=true></span>
<span class="sr-only">Next</span>
</a>
但是我在页面上看不到这个轮播。但页面源显示它。 如果只有轮播代码在页面上,它工作正常。 插入代码以显示其他项目后,它们正在显示,但轮播消失了。
答案 0 :(得分:0)
您缺少数据目标和数据幻灯片以及许多地方的双引号。重新检查您的代码。
<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>