错误:欢迎部分的高度应等于视口的高度。
这是我的HTML,
<div id = "My-Portfolio">
<nav id="navbar">
<a href = "#welcome-section">Projects</a>
</nav>
<div id="welcome-section">
<div class = "move"> <h1> My FCC Portfolio </h1> </div>
<div id="projects">
<div class = "project-tile">
<a href="https://codepen.io/Aaradhyacodepen/pen/abbeMQQ">Here is a
technical Documentation Page that I made!</a>
</div>
</div>
</div>
</div>
<div>
<a id = "profile-link"href="https://www.freecodecamp.org/aaradhya2002"
target="_blank">profile-link</a>
</div>
CSS,
#My-Portfolio{
background-color:rgb(100,21,21,0.4)
}
#navbar{
position: fixed;
top: 0;
width:100%;
text-align:right;
background-color:rgb(100,12,12,0.4);
}
#welcome-section{
width:100%;
height:281px;
font-size:50px;
text-align:center;
}
h1{
margin-top:200px;
}
a{
color:black;
text-decoration:none;
}
@media (max-width: 400px)
{
#navbar
{
display: block:
}
}
.project-tile{
background-color:red;
width: 45%;
font-size: 40px;
margin-left: 500px;
}
运行测试时,我得到的错误为欢迎区域的高度应等于视口的高度。
这里是项目的链接:
- https://codepen.io/Aaradhyacodepen/pen/jOEEZav?editors=1100
您需要将#welcome部分的高度指定为height:100vh
。这意味着Welcome部分将占据视口高度的100%。