试图让Bootstrap 3旋转木马适合全屏?

时间:2014-01-09 16:53:50

标签: ruby-on-rails twitter-bootstrap twitter-bootstrap-3 fullscreen carousel

当我运行此图像和轮播溢出时,您必须向下滚动页面才能看到图像的底部和轮播......

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
<li data-target="#carousel-example-generic" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->

<div class="carousel-inner">
  <div class="item active">
<img src= "/assets/run3.jpg" width = "100%" alt="photo">
<div class="carousel-caption">
       <h3>Sign Up Now!</h3>
<p>This is Where amazing happens</p>
    </div>
  </div>


<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>

以下是发生的事情:dropbox.com/sh/tdo3928f453123h/jTbquZNM37

1 个答案:

答案 0 :(得分:0)

你可以强制你的滑块&amp;图像宽度和高度:

#carousel-example-generic,
#carousel-example-generic .item,
#carousel-example-generic .item img {
  height: 100%;
}
#carousel-example-generic .item img {
  width: 100%;
}

Bootply

注意:这不会保持比例,但它可以满足您的需求。