I get error message: The navbar should always be at the top of the viewport. But I have set the nav bar to be fixed and it worked, but I still get the error message.
can you share your code via codepen?
Sure, here it is: https://codepen.io/sp2012/full/jQJvgj/ .
Not sure why your navbar has “width: 130px;”, anyway if you add top: 0 to the #navbar it should work.
#navbar {
position: fixed;
background-color: lightgray;
// width: 130px;
width: 100%;
height: 80px;
top: 0;
}
3 Likes
Thank you, it worked.