css - Bootstrap 轮播填充与 .well 类冲突

标签 css twitter-bootstrap carousel

我正在使用 bootstrap carousal。当我添加井类时,填充成为一个问题。隐藏的幻灯片没有填充。一旦幻灯片变得可见,就会应用填充。这会产生不良的“下滑”效果。请参阅下面的链接。

http://www.bootply.com/RppJN29MXc

我正在使用 Bootstrap 中的标准 .well 类。

最佳答案

您只是将井应用于轮播的内部内容,而不是轮播本身。

如果您将 well 类移动到实际的轮播容器中,其中您有类 carouselslide,它会将它应用于整个旋转木马,你不会有那种奇怪的“闪烁”。

HTML:

<div class="container">
<div id="myCarousel" class="carousel slide well">
  <!-- Indicators -->
    <ol class="carousel-indicators">
      <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
      <li data-target="#myCarousel" data-slide-to="1"></li>
      <li data-target="#myCarousel" data-slide-to="2"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner">
      <div class="item active">
        <div class="fill" style="background-image:url('http://placehold.it/1900x1080&amp;text=Slide One');"></div>
        <div class="carousel-caption">
          <h1>Modern Business - A Bootstrap 3 Template</h1>
        </div>
      </div>
      <div class="item">
        <div class="fill" style="background-image:url('http://placehold.it/1900x1080&amp;text=Slide Two');"></div>
        <div class="carousel-caption">
          <h1>Ready to Style &amp; Add Content</h1>
        </div>
      </div>
      <div class="item">
        <div class="fill" style="background-image:url('http://placehold.it/1900x1080&amp;text=Slide Three');"></div>
        <div class="carousel-caption">
          <h1>Additional Layout Options at <a href="http://startbootstrap.com">http://startbootstrap.com</a></h1>
        </div>
      </div>
    </div>

    <!-- Controls -->
    <a class="left carousel-control" href="#myCarousel" data-slide="prev">
      <span class="icon-prev"></span>
    </a>
    <a class="right carousel-control" href="#myCarousel" data-slide="next">
      <span class="icon-next"></span>
    </a>
</div>
</div>

BOOTPLY

关于css - Bootstrap 轮播填充与 .well 类冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26950651/

相关文章:

html - 如何阻止 2 个 div 重叠?

没有 src 错误的 JavaScript 图像容器

CSS 转换不适用于内联元素

jquery - 无法使我的图像 slider ,幻灯片

javascript - "Layered"使用 slick.js 的 slider

javascript - 如何在 css 元素宽度动画中获得 60 fps?

javascript - 尝试使用 jquery 在多轮播页面上选择两个不同的起点

css - 不能垂直对齐一行内的内容

javascript - Rails 应用程序 : require bootstrap vs require bootstrap-sprockets

html - 如何在大屏幕上缩小 bootstrap 4 轮播图像