I centered some objects on a website, added some images, horizontal lines, etc. Everything works just fine but their remains some kind of 10 or 20 pixel margin on the left that I can´t edit. My centered Images are thatswhy 10-20 pixels too much on the right an an horizontal top border of a div that has 100% width does only reach from the right end of the screen to 10-20 pixels before the left end of the screen. Do you have any idea whats could be wrong with my website?
Asked
Active
Viewed 44 times
0
-
You've given us no code to look at. – Araymer Jan 19 '16 at 23:43
-
1Did you reset the default margin on the body to 0? `body { margin:0; }` – Danield Jan 19 '16 at 23:44
-
1Max, please provide both your HTML and CSS for answerers to examine. It would be great if you also created a [jsFiddle](http://jsfiddle.net), saved it, and posted the URL. – cssyphus Jan 19 '16 at 23:48
-
Ok, I will do so, just give me a few minutes :) – Max imal Jan 19 '16 at 23:49
-
Resetting the default margin already did the trick! Thank you so much! – Max imal Jan 19 '16 at 23:50
-
@Danield Please submit your comment as an answer so that it can be upvoted and marked as correct. – cssyphus Jan 20 '16 at 00:05
2 Answers
1
The body
element has a default margin
Appendix D. Default style sheet for HTML 4.
body { margin: 8px }
You can simply remove it with body { margin:0 }

Danield
- 121,619
- 37
- 226
- 255