Twitter Bootstrap Carousel全屏

时间:2013-04-10 17:32:44

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

我是RoR,Bootstrap和所有基于代码的完整菜鸟。我正在尝试在我的RoR应用程序中实现与此类似的全屏Bootstrap Carousel:http://surfscore.me/

这是我到目前为止所做的:http://cryptic-woodland-6000.herokuapp.com/

任何人都可以告诉我为什么我无法将图像提升到全宽......这让我发疯了!

这是我的代码:

<!DOCTYPE html>
<html lang="en">
  <head>

    <style>

    /* GLOBAL STYLES
    -------------------------------------------------- */
    /* Padding below the footer and lighter body text */

    body {
      padding-bottom: 0px;
      height: 100%;
      width: 100%;
      color: #5a5a5a;
      margin: 0;
      margin-right: 0;
      min-height: 100%;
    }



    /* CUSTOMIZE THE NAVBAR
    -------------------------------------------------- */

    /* Special class on .container surrounding .navbar, used for positioning it into place. */
    .logo-holder {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      z-index: 10;
      margin-top: 5%;
      margin-bottom: -90px;
      margin-left: 5%;
      /* Negative margin to pull up carousel. 90px is roughly margins and height of navbar. */
    }


    /* Carousel base class */
    .carousel {
      margin-bottom: 0px;
    }



    .carousel-control {
      height: 80px;
      margin-top: 0;
      font-size: 120px;
      text-shadow: 0 1px 1px rgba(0,0,0,.4);
      background-color: transparent;
      border: 0;
      z-index: 10;
    }

    .carousel .item {
      height: 100%;
    }
    .carousel img {
      position: relative;
      top: 0;
      left: 0;
      min-height: 100%;
      min-width: 100%;
      margin: 0;

    }

    .carousel-caption {
      background-color: #0001;
      position: absolute;
      max-width: 400px;
      padding: 35px 20px;
      margin-top: 40px;
      margin-left: 50px;
      margin-bottom: 45%;
      z-index: 20;
    }
    .carousel-caption h1,
    .carousel-caption .lead {
      margin: 0;
      line-height: 1.25;
      color: #fff;
      text-shadow: 0 4px 4px rgba(0,0,0,.4);
    }
    .carousel-caption .btn {
      margin-top: 10px;
    }


/* Footer
    -------------------------------------------------- */
.footer {
  padding: -90;
}




    </style>



    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="../assets/js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="../assets/ico/favicon.png">
  </head>

  <body>



  <!-- Logo attempt
    ================================================== -->
<div class="logo-holder">
  <img src="images/hselogo.png">
</div>

  <!-- Carousel
    ================================================== -->

    <div id="myCarousel" class="carousel slide" >
      <div class="carousel-inner">
        <div class="carousel-caption">
              <h1>COMING SOON!</h1>
              <p class="lead">We're busy doing some 'market research'!</p>
              <a class="btn btn-large btn-primary" href="#">Sign up today</a>
            </div>
        <div class="item active">
          <img src="images/greek1.jpg" alt="">


        </div>
        <div class="item">
          <img src="images/hotel.jpg" alt="">

        </div>
        <div class="item">
          <img src="images/mykonos.jpg" alt="">

        </div>
      </div>
      <a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>
      <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>
    </div><!-- /.carousel -->




      <!-- FOOTER -->
      <footer>
        <p class="pull-right">91-93 Buckingham Palace Rd, London, SW1W 0RP.</p>
        <p>&copy; 2013 HOP SKIP ESCAPE LTD &middot; <a href="#">Privacy</a> &middot; <a href="#">Terms</a></p>
      </footer>

    </div><!-- /.container -->




  </body>
</html>

1 个答案:

答案 0 :(得分:1)

enter image description here您可以通过删除容器类

来实现类似的效果