html - 如何在轮播中完全适合图像(Bootstrap)

标签 html css twitter-bootstrap twitter-bootstrap-3

我制作了一个功能齐全的旋转木马,但问题是在旋转木马的右侧出现了白色 block 。我想摆脱它。请帮忙。

Example

<div class="carousel-inner">
  <div class="item active">
    <img src="Jellyfish.jpg" alt="image">
    <div class="carousel-caption">
      <h2>This is the heading</h2>
      <p>This is paragraph</p>
    </div>
  </div>
  <div class="item">
    <img src="Koala.jpg" alt="image">
    <div class="carousel-caption">
      <h2 style="color:orange">This is the heading</h2>
      <p>This is paragraph</p>
    </div>
  </div>
  <div class="item">
    <img src="Penguins.jpg" alt="image">
    <div class="carousel-caption">
      <h2>This is the heading</h2>
      <p>This is paragraph</p>
    </div>
  </div>
    <a href="#caro" class="left carousel-control" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    <a href="#caro" class="right carousel-control" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right"></span>
    </a>
</div>

最佳答案

设置图片width:100%

.item img {
  width:100%
}

这是演示:https://jsfiddle.net/u9kkdLzb/

关于html - 如何在轮播中完全适合图像(Bootstrap),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40152487/

相关文章:

Javascript : How to get multiple span elements by ID?

html - html中如何在按钮下方添加一条1px的水平白线

html - fiddley navigation - 无序列表和背景颜色中的无序列表

css - 使用 bootstrap 时更改 href 行为

php - xampp 中的样式与我桌面上的文件不同?

html - 屏幕尺寸太小时文本重叠

css - 使用背景图像的图像梯度比它上面的图像高

css - 为什么这个div容器是固定高度,不能设置成100%?高度从何而来?

html - 将指向特定页面的链接偏移 80px

jquery - Bootstrap 需要 JQuery(使用 Express 和 Parse)