Navbar position

Hey guys, I would like to know if someone can point to me how I can put the navbar above the header on my pen for the product landing page project.
Here is the link: https://codepen.io/darrylat/full/bGBaYKy

Try this:

#nav-bar ul {
 background: rgba(0,0,0,0.4);
  position: fixed;
  top: 0;
}

#nav-bar li a{
	color: #fff;
  font-size: 16px;
  font-weight: bolder;
}

oh, also remember to start you css with the your html elements in order, so nav, then header then sections respectively. It just makes your code a little easier to read and debug.

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

Thank you, lol - did’nt know this before :sweat_smile:

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