Bootstrap Carousel图像不适用

时间:2015-09-06 18:57:31

标签: javascript jquery html css twitter-bootstrap

我已经遇到这个问题多年了,有时我只是放弃但现在我决定不...我不能将图像应用到Bootstrap Carousel,这是我的css代码应该有效:

[Knight@28d93b30, Knight@1b6d3586, Knight@4554617c]

我正在从Youtube做一个教程,我按照她在那里做的确切方式:https://www.youtube.com/watch?v=DKWyr35srS4

是的,我记得要标记jQuery和Bootstrap js文件。 我不知道,我也遇到了与非Bootstrap项目相同的图像问题。我应该将图像文件路径放置到html和css吗?

1 个答案:

答案 0 :(得分:0)

Click here for Fiddle

<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <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>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="..." alt="...">
      <div class="carousel-caption">
        ...
      </div>
    </div>
    <div class="item">
      <img src="..." alt="...">
      <div class="carousel-caption">
        ...
      </div>
    </div>
    ...
  </div>

  <!-- Controls -->
  <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>
</div>

直接关注bootstrap页面:Carousel