flexbox layout working - top, content, bottom

top, content, bottom

by hrabinowitz

HTML

<div class='top'>
  <div class='one'>
  one
  </div>
  <div class='content'>
  content
  </div>
  <div class='bottom'>
  bottom
  </div>
</div>

CSS

.top {
  height: 100vh;
  background: red;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.one {
  height: 50px;
  background: yellow;
  margin: 0;
  padding: 0;
}
.content {
  flex: 1;
  background: gray;
}
.bottom {
  height: 70px;
  background: green;
}