Sizing a child to 100% height of parent element

author's avatar
Kees de Kooter
Feb 15 2021 21:15
  1. make sure the body is sized to the max

    html, body {
      height: 100vh;
    }
  2. size the child (and all intermediate elements) to 100%

    .the-child {
      display: flex;
      height: 100%;
    }