I'm facing an error on a coding challenge that says: "The height of the welcome section should be equal to the height of the viewport." I have set it to 100vh but I'm unsure how to resolve it.
Here is the HTML code:
<header>
<nav id="navbar">
<a href="#welcome-section" id="logo-link">
<h1>Welcome</h1>
</a>
<ul class="nav-list">
<a href="#projects">
<li>Projects</li>
</a>
<a href="#profile">
<li>Profile</li>
</a>
<a href="#contact">
<li>Contact</li>
</a>
</ul>
</nav>
</header>
<!--BODY-->
<body>
<section id="welcome-section">
<div class="header-text">
<h1><code>Hello World!</code></h1>
<p>My name is Nick</p>
</div>
</section>
CSS Styles:
#navbar {
position: fixed;
top: 0;
height: 80px;
width: 100%;
background-color: #007cc7;
display: flex;
justify-content: space-between;
z-index: 5;
}
.nav-list {
display: flex;
margin-right: 20px;
margin-top: auto;
margin-bottom: auto;
}
.nav-list a {
display: block;
font-size: 1.5rem;
padding: 10px;
color: white;
}
.nav-list a:hover {
color: cyan;
}
#logo-link {
color: white;
margin-top: auto;
margin-bottom: auto;
margin-left: 10px;
font-size: 1.5rem;
}
#welcome-section {
height: 100vh;
margin-top: 20px;
text-align: center;
background-color: #12232e;
border-style: solid;
border-color: #203647;
border-width: 10px;
border-top: 0;
border-right: 0;
border-left: 0;
display: flex;
}
.header-text {
margin: auto;
}
#welcome-section h1 {
font-size: 5rem;
}
#welcome-section p {
font-size: 1.5rem;
}
Access the challenge here: https://www.freecodecamp.org/learn/responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage