为什么 body 没有拉伸到整个视口高度?

Why isn't the body stretching to full view port height?

我正在制作一个投资组合网站,现在正在处理项目部分。我正在为主要 div 包装器使用网格显示。在我的 CSS 开头,我将 .main、body 和 html 的边距设置为 0,这样我就没有任何剩余的 space双方。出于某种原因,页面底部有一个奇怪的空白: 我尝试将更多元素的边距设置为 0,但似乎没有任何效果。您知道是什么原因造成的吗?

@import url("https://fonts.googleapis.com/css?family=Roboto&display=swap");
html,
body,
.main {
  margin: 0;
  height: 100%;
  width: 100%;
}

body {
  background-image: radial-gradient(#181818, #050505);
}

body .nav {
  margin: 10px 0;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  font-size: 2vw;
}

body .nav a,
body .nav a:visited {
  border-radius: 5px;
  padding: 0.2vh 0.65vw;
  margin: auto 30px;
  color: whitesmoke;
  text-decoration: none;
  -webkit-transition: 0.275s;
  transition: 0.275s;
}

body .nav a:hover {
  color: #f2f2f2;
  background-color: rgba(163, 163, 163, 0.1);
}

body .main {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 2.5% 30% 2.5% 30% 2.5% 30% 2.5%;
      grid-template-columns: 2.5% 30% 2.5% 30% 2.5% 30% 2.5%;
  -ms-grid-rows: 2.5% 40% 2.5% 40% 2.5%;
      grid-template-rows: 2.5% 40% 2.5% 40% 2.5%;
}

body .main img {
  border-radius: 3%;
  height: 100%;
}

body .main #img1 {
  -ms-grid-column: 2;
  -ms-grid-column-span: 1;
  grid-column: 2/3;
  -ms-grid-row: 2;
  -ms-grid-row-span: 1;
  grid-row: 2/3;
}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Projects</title>
    <link rel="stylesheet" href="../../styles/styles-projects.css" />
  </head>
  <body>
    <div class="nav">
      <a href="../portfolio/portfolio.html">PORTFOLIO</a>
      <a href="../../../index.html">HOME</a>
    </div>
    <div class="main">
      <img id="img1" src="../../images/Project-1.PNG" alt="Project card" />
    </div>
  </body>
</html>

要点代码:https://gist.github.com/VlatkoStojkoski/d8f9f300fbd57f5987c6bb66fb9206bf

您已将 grid-template-rows 设置为仅等于身高的 87.5%。

如果您将这些值调整为等于 100%,则将正确填充整个高度

grid-template-rows: 2.5% 45% 5% 45% 2.5%