flex-test-1

by Vikas

HTML

<div class="root">
     <div class="container">
       <div class="body">
         <h1>THIS IS H1
         </h1>
         <h1>THIS IS H1
         </h1>
         <h1>THIS IS H1
         </h1>
         <h1>THIS IS H1
         </h1>
         <h1>THIS IS H1
         </h1>
         <h1>THIS IS H1
         </h1>
         <h1>THIS IS H1
         </h1>
         <h1>THIS IS H1
         </h1>
       </div>
       <div class="footer">
         Footer
       </div>
     </div>
   </div>

CSS

.root {
  font-size: 13px;
  line-height: normal;
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  height: 90vh;
}

.container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.body {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.footer {
  flex: 0 0 auto;
  border-top: 1px solid;
}