problem: both the top and the low end are laid out with fixed, scroll the browser"s scroll bar to the lowest end, the main content can not be fully displayed, and there is a blank part.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
body{
margin: 0;
padding: 0;
color: -sharpfff;
}
.container{
width: 800px;
height: 1000px;
background: -sharp4c77f2;
margin: 0 auto;
padding-top: 40px;
text-align: center;
padding-bottom:100px;
}
.header{
width:800px;
position: fixed;
height: 40px;
background: -sharp414141;
text-align: center;
font-size: 16px;
line-height: 40px;
left:50%;
transform:translateX(-50%);
}
.footer-div{
height: 100px;
line-height:100px;
width: 800px;
position:fixed;
bottom:0;
}
.footer{
height:inherit;
width:inherit;
background: -sharp333;
text-align: center;
font-size: 16px;
position:inherit;
left:50%;
transform:translateX(-50%);
}
</style>
</head>
<body>
<div>
<div class="header"></div>
<div class="container">
</div>
<footer class="footer-div">
<div class="footer"></div>
</footer>
</div>
</body>
</html>
defect effect is shown in figure
expected effect: how to scroll the browser scroll bar without adding a scroll bar to the main content, the main content is displayed and there is no blank area?