NAVBAR fixed to top of viewport....it is.... help please

Tell us what’s happening:
I can’t figure out why I am failing the navbar at the top of the viewport. The position is fixed already and the navbar moves as it should with the page.

Your code so far

<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="styles.css" />
    <title>Portfolio</title>
</head>

<body>
    <header>
        <nav id="navbar">
            <ul class="nav-list">
                <li><a href="#welcome-section">About</a></li>
                <li><a href="#projects">Projects</a></li>
                <li><a href="#contact">Contact</a></li>
            </ul>
        </nav>
    </header>
    <section id="welcome-section">
        <h1>Welcome to my portfolio!</h1>
        <h2>My name is Nebuchadnezzar.</h2>
        <p>
            I am looking forward to potentially working together. Take a little scroll down if you don't mind...
        </p>
    </section>
    <section id="projects">
        <h1>These are some of the projects I've worked on</h1>
        <div class="project-tile">
            <a href=""></a>
            
        </div>
    </section>
    <section id="contact">
        <h1>I was thinking the same thing...We should probably work together.</h1>
        <p>Contact Me</p>
        <p>link will go<a id="profile-link" href"" target="_blank"> here</a>
    </section>
</body>

</html>
        box-sizing: border-box;
        margin: 0%;
        padding: 0%;
    }
    #navbar {
        position: fixed;
        z-index: 1;
        
        
    }
    
    header {
        position: fixed;
        background: rgb(36, 0, 0);
        background: linear-gradient(162deg, rgba(36, 0, 0, 1) 0%, rgba(158, 54, 54, 1) 100%);
        display: flex;
        justify-content: flex-end;
        width: 100%;
        height: 75px;
        align-items: center;
        
    }
    
    .nav-list li {
        list-style: none;
        display: inline-block;
        padding: 0px 20px;
    }
    
    .nav-list li a {
        text-decoration: none;
        font-size: 35px;
        color: white;
    }
    
    li a:hover {
        color: gray;
    }
    
    #welcome-section {
        background: rgb(0, 0, 0);
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.7680457746478873) 2%, rgba(107, 95, 95, 0.7088908450704225) 100%);
        width: 100%;
        height: 100vh;
        color: whitesmoke;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 300px;
    }
    
    #welcome-section h1 {
        font-size: 50px;
        text-align: center;
        padding-top: 10px;
    }
    
    #welcome-section h2 {
        font-size: 35px;
        text-align: center;
        padding-top: 20px;
    }
    
    #welcome-section p {
        font-size: 28px;
        text-align: center;
        padding-top: 25px;
    }
    
    #projects {
        background-color: rgb(63, 2, 2);
        width: 100%;
        height: 100vh;
    }
    
    #projects h1 {
        font-size: 50px;
        text-align: center;
        padding-top: 50px;
        color: whitesmoke;
    }
    
    #contact {
        width: 100%;
        height: 80vh;
        background-color: #45567d;
    }
    
    #contact h1 {
        font-size: 28px;
        text-align: center;
        padding-top: 75px;
        color: whitesmoke;
    }
    
    #contact p {
        text-align: center;
        font-size: 23px;
        padding-top: 35px;
        text-decoration: underline;
        color: whitesmoke;
    }


 @media (min-width: 600px) {
     p {1.25rem}

 }   

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: Personal Portfolio Webpage - Build a Personal Portfolio Webpage

Link to the challenge:

fixed, yes. But not at the very top of the viewport.
I can see a thin area at the top above the navbar.
You have to get rid of that so that the navbar sits flush right at the very top.

1 Like

WOWWWW.
top: 0;
Thats all it was. Thank you so much!!! good eye btw

1 Like