Help with Landing Page project

There is a space between the top of my navbar and the top of the screen. I’ve been fiddling around with the margins and padding of the elements, but I can’t figure out what’s causing it. Any help would be greatly appreciated.

https://codepen.io/chadwick300/pen/jOBrZNy?editors=1100

Hi @kylecstreet !

Welcome to the forum!

If you add top:0; to the header selector then it should fix the issue.

But also, you should not have these inline styles here

  <body style="margin: 0;">
    <header style="margin: 0;" id="header">
      <nav style="margin: 0;" id="nav-bar">

You could add a basic css reset instead

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

Thanks for the reply!

I’m such a newbie with this stuff. The inline styles was my way of trying different stuff to get the navbar to move up. But I’ll delete that junk code.

Can you explain the concept of a css reset please? That’s a new one for me. Thanks in advance!

Not to be rude but this is something you should search/research and then come back with a question if there’s something you don’t understand.

I see your point. Will do. Thanks!

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