This is how my nav should look but fixed
instead when I add fixed it turns into this…
My codepen > https://codepen.io/rubyNY/pen/GLyrbR
This is my code:
<body class="container">
<header id="header">
<img id="header-img" src="https://png2.kisspng.com/sh/4e9515f7e68f163bbee410c2e5957878/L0KzQYm3VMIxN517j5H0aYP2gLBuTfNwbpdqfZ91b3fyPbTokQB2a5RuhtG2Y3zsgH7okwQub5CyjtdsdHB1PYbohMliaWdpT9VvNkS7PoOAUcMzQGU5Sac7NEK0RISBUcUyOWoziNDw/kisspng-coffee-logo-cappuccino-clip-art-go-vector-5ad9aa6d7cf648.2713284415242143815119.png" alt="coffee cup logo">
<nav id="nav-bar">
<a class="nav-link" href="#about">ABOUT US</a>
<a class="nav-link" href="#gallery">GALLERY</a>
<a class="nav-link" href="#contact">CONTACT</a>
</nav>
</header>
<section class="main">
<div>
<img src="http://pluspng.com/img-png/waffle-breakfast-png-it-s-waffles-day-we-inspire-life-754.png">
</div>
<div class="form">
<h1>Fresh Breakfast Served Daily</h1>
<span>subscribe for weekly coupons</span>
<form id="form" action="/">
<input type="email" name="email" id="email" placeholder="enter your email" />
<input id="submit" type="submit" value="Get Coupons" class="btn"></input>
</form>
</div>
</section>
<section id="about">
<div>
<h1>TEST TEST TEST</h1>
</div>
</section>
<section id="gallery">
<div>
<h1>TEST TEST TEST</h1>
</div>
</section>
<section id="contact">
<div>
<h1>TEST TEST TEST</h1>
</div>
</section>
</body>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
CSS
body {
margin: 0;
padding: 0;
background-color: white;
color: black;
font-family: sans-serif;
}
#header {
position: fixed;
display: flex;
justify-content: space-between;
align-items: center;
}
#header-img {
width: 100px;
height: 110px;
}
#nav-bar a {
margin: 0;
padding: 1rem;
text-decoration: none;
color: inherit;
}
#nav-bar a:hover {
color: #ff9c11;
}
.container {
max-width: 1400px;
margin: 0 auto !important;
padding: 0 40px !important;
}
h1 {
font-weight: 500;
font-size: 3rem;
margin-bottom: .5rem;
margin-top: 4rem;
}
span {
font-weight: 500;
font-size: 1.4rem;
margin-bottom: 2rem;
}
input {
padding: .75rem 1.5rem;
border-radius: .5rem;
}
.btn {
color: white;
background-color: #ff9c11;
padding: .75rem 1.5rem;
border-radius: .5rem;
font-size: .9rem;
}
.form {
float: right; !important
}
.main img {
width: 25rem; !important
height: 25rem; !important
float: left; !important
margin-left: 10rem; !important
}
/* GLOBAL */
section {
margin: auto;
overflow: hidden;
display: flex;
justify-content: center;
}
/* responsive */
@media (max-width: 1362px) {
.main img {
display: none;
}
.form {
text-align: center;
float: none;
}
}




