I have tried setting the margin attribute to 0px, but it does not work.

2 answers

0
points
This was chosen as the best answer

I set the margin attribute in a div-element inside the body-element, instead of in the body-element.

Answered about 6 years ago by Geoffrey Van Wyk
0
points

The body has a default margin, so try to use:

html, body {
margin:0;
padding:0;
}
Answered about 6 years ago by Ramil Alcibar