Your #nav-bar should always be at the top of the viewport.?

I’m doing Build a Product Landing Page and it says “Your #nav-bar should always be at the top of the viewport.”

I couldn’t figure it out. can anyone help me ?

2 Likes

Use position: fixed;

header {
  position: fixed;
  top: 0px;
}
7 Likes

Hi @cjh8710 !

When you get ready to submit this project, you will need to copy all of your html and css code into the new fcc editor since codepen links will no longer be accepted.

You will also need to link the css to the html document

<head>
  <link rel="stylesheet" href="styles.css">
</head>
4 Likes

I tried… but still not working

2 Likes

I did this but still shows “Your #nav-bar should always be at the top of the viewport.”

The issue is with the padding in the header.

header {
  position: fixed;
  top: 0px;
  width: 100%;
  height: 19px;
  padding: 25px 0px;

remove it and it will pass

5 Likes

Thank you very much for your answer, I do have a “s” character missing from “styles”.

the problem is in your video or iframe
check its position

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