-1
我正在按照教程尝试创建管理面板,但我在某个时候被卡住了。我正在努力使navabar +文本达到最大程度,但它们有点“包装内容”。Rails - HTML页面不会占用全部高度
这是我的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
编辑:我忘了提。我尝试了所有我能找到的解决方案,但它不会全力以赴。
是的,如果我分开他们它的工作。 –
当'body'为'100%'且'html'为'0px'高时,body就是'0px'的100%',因此仍然是'0px'。所以通常记得设置html的高度以及:) –
我有他们那样,但他们在同一行 –