Changing the layout problem of mobile terminal on pc side

there is a problem when changing the pc side to the mobile end. The header is fixed and the middle content is loaded dynamically, but copyright information will be added at the bottom of the final page, but when the intermediate content is not enough, the bottom content should still be at the bottom of the app. Instead of fixed positioning, it is best to use css to complete it. For a moment, I didn"t think of how to deal with it, asking for ideas or related articles such as

.

clipboard.png

Aug.27,2021

the min-height of the intermediate content is set to calc (100vh-the height of the copyright section). Since the head is estimated to be fixed, there is no need to subtract

.

the following is the code

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width">
  <title>Title</title>
  <style>
    body{
      margin: auto;
    }
    .header{
      position: fixed;
      top: 0;
      width: 100%;
      height: 20px;
      background-color: pink;
    }

    .copyright{
      height: 20px;
      padding-bottom: 15px;  
    }

    .content{
      box-sizing: border-box;
      padding-top: 25px;
      min-height: calc(100vh - 35px); /* 35copyright*/
      /*height: 1000px;*/  
    }
  </style>
</head>

<body>
  <div class="header"></div>
  <div class="content">
    
  </div>
  <div class="copyright"></div>
</body>

</html>

gets the height of the head and bottom. Set min-height for the intermediate content.


since the height of the head and bottom is the same, set the minimum height of the middle dynamic loading position:

min-height: calc(100vh -  - )
Menu