我正在使用 bootstrap carousal。当我添加井类时,填充成为一个问题。隐藏的幻灯片没有填充。一旦幻灯片变得可见,就会应用填充。这会产生不良的“下滑”效果。请参阅下面的链接。
http://www.bootply.com/RppJN29MXc
我正在使用 Bootstrap 中的标准 .well
类。
最佳答案
您只是将井应用于轮播的内部内容,而不是轮播本身。
如果您将 well
类移动到实际的轮播容器中,其中您有类 carousel
和 slide
,它会将它应用于整个旋转木马,你不会有那种奇怪的“闪烁”。
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&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&text=Slide Two');"></div>
<div class="carousel-caption">
<h1>Ready to Style & Add Content</h1>
</div>
</div>
<div class="item">
<div class="fill" style="background-image:url('http://placehold.it/1900x1080&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>
关于css - Bootstrap 轮播填充与 .well 类冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26950651/