Fixed #navbar in Portfolio exercise not accepted

The Test is not passing my code for the top fixed #navbar.
‘’’

#navbar {
    background-color: rgb(179, 58, 58);
    height: 7rem;
    text-align: right;
    padding-top: 2rem;
    position: fixed;
    width: 100%;
}

‘’’

Link to the files are here: GitHub - Itanglish1/personal-portfolio-exercise: Final test for Free Code Camp responsive Web Design Project .

I might have something not working with the rest of the code.

Exercise is at the time of writing, not finished and missing queries.

I have opened a request on GitHub but I was sent over here to see if it can be fixed, or it’s a website issue.

Thanks

Have you set the top margin to 0?

1 Like

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

1 Like

Note: In your html you linked the css using a file name of style.css

<link rel="stylesheet" href="style.css" />

When you paste the code into freecodecamp make sure to change the file name of the link element to styles.css

Update:
When I change the link element’s href to styles.css, the navbar remains at the top, But you dont seem to have any media queries?

@Cryptic_X I have done a soft reset :

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

Haven’t finished the exercise yet, so no media queries yet

@JeremyLT
Thanks for the tip

I think the problem is with the link element, ok?
Can you see your css effects in the preview.

WOW, POOF!

Mind blown, one letter and it is all fixed!!! It was how the css file was linked

Thanks

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.