The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.
You will need to take an additional step here so the code you wrote presents in an easy to read format.
Please copy/paste all the editor code showing in the challenge from where you just linked.
how do i get my nav-bar to the top
Replace these two sentences with your copied code.
Please leave the line above and the line below,
because they allow your code to properly format in the post.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Product Landing Page - Build a Product Landing Page
I’ve edited your code 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.
What don’t you get specifically? Have you changed your code?
Please try to explain yourself in more detail in future. It is important in coding to make sure other coders know exactly what you need help with.
Also, if you want to reply directly to someone, so they are notified of your reply, press the button that says ‘reply’ with a left pointing arrow next to it.
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8"/>
<link rel="stylesheet"href="styles.css">
</head>
<body>
<div class="page-wrapper">
<header id="header">
<img id="header-img"src="https://cdn.freecodecamp.org/testable-projects-fcc/images/product-landing-page-logo.png"alt="Trombones logo"/>
<nav id="nav-bar">
<ul>
<li><a class="nav-link"href="#features">Features</a></li>
<li ><a class="nav-link"href="#how it works">How it works</a></li>
<li><a class="nav-link"href="#pricing">Pricing</a></li>
</ul>
</nav>
</header>
<div class="container">
<section id="hero">
<h2>Handcrafted, home-made masterpieces</h2>
<form id="form"action="https://www.freecodecamp.com/email-submit">
<input id="email"type="email"name="email"placeholder="Enter your e-mail address"/>
<input id="submit" type="submit"name="submit"value="Get started"/>
</form>
</section></div>
<div class="container">
<section id="features">
<div class="life">
<div class="icon"><i class="fa fa-3x fa-fire"><i></div>
<div class="description">
<h2>
Premium Materials</h2>
<p>Our trombones use the shiniest brass which is sourced locally. This will increase the longevity of your purchase</p>
</div>
</div>
<div class="life">
<div class="icon"><i class="fa fa-3x fa-truck"><i></div>
<div class="description">
<h2>
Fast Shipping</h2>
<p>We make sure you recieve your trombone as soon as we have finished making it. We also provide free returns if you are not satisfied.</p>
</div>
</div>
<div class="life">
<div class="icon"><i class="fa fa-3x fa-battery-full"></i></div>
<h2>
Quality Assurance</h2>
<p>For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.</p>
</div>
</section>
</div>
<div class="container">
<section id ="how it works">
<iframe id ="video"height="315"src="https://www.youtube-nocookie.com/embed/y8Yv4pnO7qc?rel=0&controls=0&showinfo=0"frameborder="0"></iframe>
</section>
</div>
<div class="container">
<section id ="pricing">
<div class="product" id="tenor">
<div class="level">TENOR TROMBONE</div>
<h2>$500</h2>
<ol>
<li>Available</li>
<li>Available</li>
<li>Available</li>
</ol>
<button class="select">Select</button>
</div>
<div class="product"id="bass"
<div class="level">BASS TROMBONE</div>
<h2>$900</h2>
<ol>
<li>Available</li>
<li>Available</li>
<li>Available</li>
</ol>
<button class="select">Select</button>
</div>
<div class="product"id="Valve"
<div class="level">VALVE TROMBONE</div>
<h2>$1000</h2>
<ol>
<li>Available</li>
<li>Available</li>
<li>Available</li>
</ol>
<button class="select">Select</button>
</div>
</section>
</div>
</body>
</html>
The position:fixed is applied to your #nav-bar, this means everything inside the #nav-bar will stick to the top of the screen.
But you’ve got elements like the img that are not inside #nav-bar, they are inside the header element. So they are not affected by position:fixed and will not move with the rest of the navigation menu content.
Which element that contains all your nav-links and header image could have position:fixed applied to it so everything in your navigation menu sticks to the top of the screen?