Header has a space, how to remove it.

Hi guys, my header has a space its not filling in at the top. I dont have any margin-top or anything. How can i resolve this easily and make the header responsive. If i give the header a flex the whole nav is going wrong. https://codepen.io/Boeroe/pen/QWzeEez
Boeroe
CodePen
QWzeEez
...
20 Replies
Mannix
Mannix•15mo ago
both body and ul element have default margin applied to them check in dev tools 🙂
Boeroe
BoeroeOP•15mo ago
I've both set them to 0, but then the nav ul is gettin all to the right. If i set a margin-top right its not getting the result. https://codepen.io/Boeroe/pen/QWzeEez
Boeroe
CodePen
QWzeEez
...
Mannix
Mannix•15mo ago
margin-top instead of margin should work on both
Boeroe
BoeroeOP•15mo ago
It's still all to the right
Mannix
Mannix•15mo ago
what do you mean?? it has 8px margin on both sides give your li's some padding if you don't want them to stick to right edge of the header or to the ul
Boeroe
BoeroeOP•15mo ago
https://codepen.io/Boeroe/pen/QWzeEez now it has to move more to the right. With padding its getting to big gaps and the header is moving with it.
Boeroe
CodePen
QWzeEez
...
Boeroe
BoeroeOP•15mo ago
No description
Mannix
Mannix•15mo ago
I'm consfused at this point. What is your desired outcome ??
MarkBoots
MarkBoots•15mo ago
if you want more spaces at the sides, you can use padding-block on the ul, or the header
Judy
Judy•15mo ago
You have a padding of 3rem in your .nav-list li I think that is your problem You can use the margin-inline property to space your nav-list but you should use the :not-lastchild selector so you won't add it to the last element Or Shortcut, add a gap property to your nav list where you have the display: flex; In your header, remove the height of 20%... It is not doing anything in your css Use pixels if you want to add a specific height
Boeroe
BoeroeOP•15mo ago
https://codepen.io/Boeroe/pen/QWzeEez i fixed it i think. Any feedback is welcome on how to improve it or what can be edited
Boeroe
CodePen
QWzeEez
...
Mannix
Mannix•15mo ago
instead of those big 10rem margins that will give you headaches later you could just switch justify-content: space-between; to justify-content: space-around; or wrap your logo and navigation in a div and give it a max-width: 80% plus margin-inline: auto;
Boeroe
BoeroeOP•15mo ago
I like it the first way! Ty so much
Mannix
Mannix•15mo ago
thumbup
Boeroe
BoeroeOP•15mo ago
One more thing if i add text-decoration: none to the logo its working but to the ul/li not. Why is that ?
Mannix
Mannix•15mo ago
because you need to target the a not li or ul the a element has it
Jochem
Jochem•15mo ago
Which of because a has a default text decoration on it, which is overriding the value you're setting on the patent element
Boeroe
BoeroeOP•15mo ago
Thanks lads!
Want results from more Discord servers?
Add your server