Retroactively applying skills learned

Hi there folks,

I’m in the process of adding some of the things i’ve learned recently to an ongoing project that involves my gaming hobby. Does anyone have any insight in terms of what code can be used in CSS to clear the gap between the navigation bar and the top of the page. Please see attached photo for query.

Hey!

Usually when something like this happens it’s because of the default padding/margin. So all you need to do is add a rule that affects all of your visible HTML, essentially making a new default for those properties. Normally this can be fixed by adding something like this to your css file:

body {
    margin: 0;
    padding: 0;
}

If that doesn’t fix it, let me know!

You may also want to include a reset on the box-sizing on all elements and pseudo-elements:

*,
*::before,
*::after {
  box-sizing: border-box;
}
1 Like