如何使用bootstrap消除额外的html体高

时间:2016-02-26 17:26:55

标签: html twitter-bootstrap height whitespace extra

我正在使用引导程序,并在我的身体末端获得大量的“白色空间”。

Extra Whitespace

Bootstrap似乎是手动设置我的html主体的高度,我无法覆盖它。有没有人知道如何摆脱这个额外的空白?

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <!--<link rel="icon" href="../../favicon.ico"> -->

    <title>Human Time Capsule</title>

    <!-- Bootstrap core CSS -->
    <link href="bootstrap/dist/css/bootstrap.css" rel="stylesheet">

    <!--Google fonts -->
    <link href='https://fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>

    <!-- Custom styles for this template -->
    <link href="bootstrap/dist/css/navbar-fixed-top.css" rel="stylesheet">
    <link href="bootstrap/dist/css/style.css" rel="stylesheet">


  </head>

  <body>
    <!-- Fixed navbar -->
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">

            <li><a href="../navbar-static-top/">The Project</a></li>
            <li><a href="../navbar-static-top/">The Archive</a></li>

          </ul>
        </div>
      </div>
    </nav>

    <div class="container">

        <div class="row">
          <p class="header"> {Human <br>Time<br> Capsule}</p> 
        </div>

        <div class="embed-responsive embed-responsive-16by9">
          <iframe class="embed-responsive-item" src="https://player.vimeo.com/video/155851911?autoplay=1"></iframe>
        </div>



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

    <footer class="footer">
      <div class="container">
        <div class="contact">
          <p>More to come. Stay posted.</p>
          <p>You to come? Contact <a href="mailto:ephamilton@haverford.edu"> Evan</a> or 
          <a href="mailto:ephamilton@haverford.edu">Nick.</a></p>
        </div>      
      </div>
    </footer>



    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
    <script src="bootstrap/dist/js/bootstrap.min.js"></script>
  </body>
</html>

This is what the code looks like

Thank you!

1 个答案:

答案 0 :(得分:0)

那么你想要一个固定的高度吗?尝试将最小值/最大值设置为所需的值:

body {
  min-height: 1000;
  max-height: 1000;
  overflow-y: scroll;
}