0

i´d like to make a header with position fixed that covers the whole width and starts at the very top. But when i type in the code below i get this: output .Is there a way i can solve this problem?

#header {
    width: 100%;
    height: 100px;
    background-color: black;
}


<body>
    <header id="header"></header>  
</body>
salzig1
  • 27
  • 3

1 Answers1

1

This article right here will help you : https://css-tricks.com/reset-all-margins-padding/

By default, pages load with some padding and margin. This is why, unless you remove this default padding, all elements will be a little off from the page edges.

The Universal selector * allows you to reset the border as such :

    * {
    padding: 0;
    margin: 0;
}
Emile Haas
  • 370
  • 3
  • 14