使左右div为视口的100%高度

inn*_*ion 1 html css css3

我正试图设置height:100%div,但它不起作用.有什么问题?有人可以帮我吗?

body{
  background-color:black;
}
.container {
  position: relative;
  overflow: hidden;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 1170px;
  min-width: 300px;
  margin-top: 47px;
  margin-right: auto;
  margin-left: auto;
  min-height: 100%;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -o-box-sizing: border-box;
  -moz-box-sizing: border-box;
}
.left {
  width: 20%;
  height: 100%;
  float: left;
  position: absolute;
  bottom: 0px;
  background-color: #364150;
  border-left: 1px solid #3d4957;
  max-height: none !important;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -o-box-sizing: border-box;
  left:0px;
}
.right {
  width: 80%;
  float: right;
  background-color: #ffffff;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -o-box-sizing: border-box;
  -moz-box-sizing: border-box;
  padding: 10px;
  min-height: 100%;
  position: relative;
  top: 0;
  right: 0;
  bottom: 0;
  overflow-y: scroll;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
  <div class="left"></div>
  <div class="right"></div>
</div>
Run Code Online (Sandbox Code Playgroud)

Sti*_*ers 5

您还需要设置height所有父容器.

html, body, .container {
  height: 100%;
}
Run Code Online (Sandbox Code Playgroud)

更新 - http://codepen.io/anon/pen/WvJpyM

您还可以使用视口单元,vh以避免这种情况.