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β€’9mo ago
both body and ul element have default margin applied to them check in dev tools πŸ™‚
Boeroe
Boeroeβ€’9mo 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β€’9mo ago
margin-top instead of margin should work on both
Boeroe
Boeroeβ€’9mo ago
It's still all to the right
Mannix
Mannixβ€’9mo 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
Boeroeβ€’9mo 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
Boeroeβ€’9mo ago
No description
Mannix
Mannixβ€’9mo ago
I'm consfused at this point. What is your desired outcome ??
MarkBoots
MarkBootsβ€’9mo ago
if you want more spaces at the sides, you can use padding-block on the ul, or the header
Judy
Judyβ€’9mo 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
Boeroeβ€’9mo 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β€’9mo 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
Boeroeβ€’9mo ago
I like it the first way! Ty so much
Mannix
Mannixβ€’9mo ago
thumbup
Boeroe
Boeroeβ€’9mo 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β€’9mo ago
because you need to target the a not li or ul the a element has it
Jochem
Jochemβ€’9mo 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
Boeroeβ€’9mo ago
Thanks lads!
Want results from more Discord servers?
Add your server
More Posts