How to fix the css flex layout up and down and keep 100% in the middle?

100% height is required in the middle, but I don"t know how to implement

Mar.01,2021

<style>
  .flex {
    display: flex;
    flex-direction: column;
    height: 100vh
  }
  .flex-item {
    flex: 1;
    overflow: auto;
  }
</style>
<div class="flex">
  <div>top</div>
  <div class="flex-item"></div>
  <div>bottom</div>
</div>
Menu