首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Bootstrap Carousel/html5shiv安装

Bootstrap Carousel/html5shiv安装
EN

Stack Overflow用户
提问于 2015-08-04 06:25:13
回答 1查看 37关注 0票数 0

我正在使用Bootstrap创建轮播。我的图片没有出现,但在旋转木马中使用的图标是appearing.Can,请谁来帮帮我。下面是我的bootstrap安装代码。

代码语言:javascript
复制
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="yas.css">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Change100 community</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.min"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
  </head>
  <body data-spy="scroll" data-target="#my-navbar">
<div class="container">
      <section>
        <div class="page-header" id="gallery">
          <h2>Gallery <small></small></h2>
        </div>
<div class="carousel slide" id="screenshot-carousel" data-ride="carousel">
          <ol class="carousel-indicators">
            <li data-target="#screenshot-carousel" data-slide-to="0" class="active"></li>
            <li data-target="#screenshot-carousel" data-slide-to="1"></li>
            <li data-target="#screenshot-carousel" data-slide-to="2"></li>
            <li data-target="#screenshot-carousel" data-slide-to="3"></li>
          </ol>
        <div class="carousel-inner">
            <div class="item">
              <img src="images/B.jpg" alt="this is the text for the image" class="active">
            </div>
            <div class="item">
              <img src="images/2.jpg" alt="">
            </div>
            <div class="item">
              <img src="images/d1.jpg" alt="">
            </div>
            <div class="item">
              <img src="images/d.jpg" alt="">
            </div>
          </div><!--End carousel-inner-->
          <a href="#screenshot-carousel" class="left carousel-control" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
          </a>
          <a href="#screenshot-carousel" class="right carousel-control" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right"></span>
          </a>
        </div><!--End of carousel-->
      </section>
    </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>
EN

回答 1

Stack Overflow用户

发布于 2015-08-04 07:08:04

您应该从以下行更改活动类:

代码语言:javascript
复制
<img src="images/B.jpg" alt="this is the text for the image" class="active">

要在div中,如下所示:

代码语言:javascript
复制
<div class="item active">
   <img src="images/B.jpg" alt="this is the text for the image">
</div>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31797763

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档