Rails - HTML页面不会占据全高

时间:2016-03-03 19:31:21

标签: html css ruby-on-rails twitter-bootstrap

我正在按照教程试图创建一个管理面板,但我在某个时候陷入困境。我试图让navabar +文本占据全高,但它们有点“包装内容”。

这是我的HTML:

<!DOCTYPE html>
<html>
<head>
  <title>TEAM 21 </title>
  <%= stylesheet_link_tag 'adminpanel', media: 'all', 'data-turbolinks-track' => true %>
  <!-- <%= javascript_include_tag 'adminpanel', 'data-turbolinks-track' => true %> -->
  <%= csrf_meta_tags %>
</head>
<body>
  <%if flash[:notice] %>
    <div class="notice"><%= flash[:notice] %></div>
  <% end %>

  <%if flash[:alert] %>
    <div class="alert"><%= flash[:alert] %></div>
  <% end %>

  <!-- HEADER
  ================================================== -->
  <div class="containter-fluid display-table">
        <div class="row display-table-row">
          <!-- Side menu -->
          <div class="col-md-2 display-table-cell valign-top" id="side-menu">
            <h1> Navigation </h1>

          </div>

          <!-- Main content area -->
          <div class="col-md-10 box display-table-cell valign-top">

            <p> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
               Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with
               the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
            </p>

            <p> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
               Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with
               the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
            </p>
          </div>
        </div>
    </div>

    <!-- CONTENT
    ================================================== -->
    <div class="buffer-top">
      <!-- <%= yield %> -->
    </div>


   <!-- 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>

 </body>
</html>

这是我的css:

    @import "bootstrap-sprockets"
@import "bootstrap"


html body
  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif
  background-color: #f3f3f4
  color: #676a6c
  height: 100%



.box
  border: 1px red dotted


#side-menu
  background-color: #2f4050
  padding: 0px

#side-menu h1
  color: #1f3647
  text-align: center
  margin: 10px 0px
  font-size: 25px

.display-table
  display: table
  padding: 0px
  height: 100%

.display-table-row
  display: table-row
  height: 100%

.display-table-cell
  display: table-cell
  height: 100%
  float: none

.valign-top
  vertical-align: top

编辑:我忘了提。我已经尝试了所有我能找到的解决方案,但它不会全力以赴。

1 个答案:

答案 0 :(得分:0)

这不是css。我认为这是sass?检查身体边缘。通常是10px。否则也会使你的html高度达到100%

html
  height: 100%