我正在尝试自定义此模板的轮播http://startbootstrap.com/templates/modern-business/ 我需要在标准的bootstrap 3容器类中插入轮播:
.container {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
问题是,如果我进入该班级内的旋转木马,它会消失,看不到任何东西......
这是轮播的代码:
<div id="myCarousel" class="carousel slide">
<!-- 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>
我该如何解决这个问题?感谢
答案 0 :(得分:3)
如果您检查模板,您将看到自定义CSS定义于:
http://startbootstrap.com/templates/modern-business/css/modern-business.css
其中一些款式使旋转木马和其他几个容器的高度和宽度均为100%。您可以添加一些CSS覆盖以实现相同的效果:
html,body {
height:100%;
}
.carousel-inner,.carousel,.item,.container,.fill {
height:100%;
width:100%;
}