css - 图像未显示在 Bootstrap 3 轮播中

标签 css twitter-bootstrap-3

我将 Bootstrap 用于图像轮播。我在轮播中有 1 张图片,但图片没有显示(它的大小被设置为 0x0,而使用 Chrome 开发者工具时自然大小是正确的)。

.imageSection {
  position: relative;
  display: inline-block;
  margin:0 auto;
  background: red;
  padding: 0px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<div class="imageSection">
      <div class="carousel slide" id="imageCarousel" data-interval="false">
        <div class="carousel-inner">
          <div class="item"><img src="http://www.clker.com/cliparts/r/0/O/0/X/O/image-of-person-sspeck-hi.png">
          </div>
        </div>
      </div>
</div>

我很确定我错过了什么。感谢对此的任何帮助!

最佳答案

您需要添加 active恰好一件 <div class="item active">

来自引导文档 http://getbootstrap.com/javascript/#carousel

Initial active element required The .active class needs to be added to one of the slides. Otherwise, the carousel will not be visible.

关于css - 图像未显示在 Bootstrap 3 轮播中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43827942/

相关文章:

php - 将站点导出到 WordPress

javascript - 如何在显示下拉菜单项时使导航栏响应

html - 为什么不能正确对齐? CSS

css - 居中一个 div,在一个 div 内的一个 div 内 - 有什么建议吗?

html - 显示大数字和侧面几个文字的信息图表的最简单方法

html - 布局 CSS 和 HTML,对齐问题

symfony - symfony2 的 Bootstrap3 bundle

twitter-bootstrap-3 - 你能嵌套 Bootstrap 容器吗?

html - 删除文本框和按钮之间的空间

html - 如何设置高度 :100% on child of flex item that has flex-grow:1?