每当我尝试以百分比形式(例如100%)编辑Bootstrap轮播的高度时,该轮播都不会响应。我如何使其高度为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%;
    }


如果可以的话请帮忙!!!

最佳答案

轮播会回复您的img。
用所需的高度定义“ slide”类:

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


对所有四个幻灯片执行此操作。

关于html - 引导轮播百分比,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32408888/

10-13 06:32