Made the menu with ul , wrapped it in the header , the header painted in a separate color. For some reason, the header does not fill the browser window to the full width, the background gaps remain a few pixels on the sides. How to get rid of these gaps?

Screenshot:

enter image description here

  • body {margin: 0; padding: 0} - dzhioev
  • use reset.css or normalize.css - soledar10

2 answers 2

Each browser has its own values ​​for padding and margin . Therefore, many people use things like css reset . Try to make

 * { margin:0; padding: 0; } 

But then it will be necessary to put down the necessary indents at the necessary blocks. This is called layout control.

     margin 0 auto; // auto для центровки header-а padding 0;