Bootstrap Carousel百分比

时间:2015-09-05 02:15:52

标签: html css twitter-bootstrap-3

每当我尝试以百分比形式(例如,100%)编辑Bootstrap Carousel的高度时,旋转木马都没有响应。如何使它的高度达到100%?

    <div class="carousel-inner" role="listbox">
    <div class="item">
      <img class="first-slide" src="https://www.apple.com/osx/elcapitan-preview/static/osx-preview/overview/hero/image_large.jpg" alt="First slide">
      <div class="container">
        <div class="carousel-caption">
          <h1>Utah Unicycling Society</h1>
          <p>The only Unicycling Society in Utah</p>
        </div>
      </div>
    </div>
    <div class="item">
      <img class="second-slide" src="http://images.nationalgeographic.com/wpf/media-live/photos/000/187/cache/canyons-utah_18730_990x742.jpg" alt="Second slide">
      <div class="container">
        <div class="carousel-caption">
          <a href="Our-Team.html" id="join"><h1 style="color:#FFF">Join Us!</h1></a>
          <p>Today, millions of people are realizing that unicycling is great. Join the Utah Unicycling Society, and become a better unicyler today.</p>
        </div>
      </div>
    </div>
    <div class="item active">
      <img class="third-slide" src="New pictures/Hands Low.jpg" alt="Third slide">
      <div class="container">
        <div class="carousel-caption">
          <a href="Donations.html" id="join"><h1 style="color:#FFF">Donate</h1></a>
          <p>We can't get money if you don't donate!</p>
        </div>
      </div>
    </div>
     <div class="item">
      <img class="fourth-slide" src="TheRoad.jpg" alt="Fourth slide">
      <div class="container">
        <div class="carousel-caption">
          <h1>The Road to Success</h1>
          <p>Here at Utah Unicycling Society, we believe in the road to success, and follow it every day.</p>
      </div>
    </div>
  </div>
  </div>

和css

    .carousel-inner{
    width:100%;
    height:100%;
    }

请帮助,如果可以的话!!!

1 个答案:

答案 0 :(得分:0)

旋转木马会响应你的img。 使用您想要的高度定义“幻灯片”类:

.first-slide {
     height: 300px;
  max-height: 300px;
}

对所有四张幻灯片都这样做。