How to remove margin space around body or clear default css styles
Solution 1:
body
has by default 8px
margins: http://www.w3.org/TR/CSS2/sample.html
body { margin:0; } /* Remove body margins */
Or you could use this useful Global reset
* { margin:0; padding:0; box-sizing:border-box; }
If you want something less *
global than:
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
some other CSS Reset:
http://yui.yahooapis.com/3.5.0/build/cssreset/cssreset-min.css
http://meyerweb.com/eric/tools/css/reset/
https://github.com/necolas/normalize.css/
http://html5doctor.com/html-5-reset-stylesheet/
…
Solution 2:
try removing the padding/margins from the body tag.
body{
padding:0px;
margin:0px;
}
Solution 3:
try to ad the following in your CSS:
body, html{
padding:0;
margin:0;
}
Solution 4:
That's the default margin/padding of the body
element.
Some browsers have a default margin, some a default padding, and both are applied as a padding in the body element.
Add this to your CSS:
body { margin: 0; padding: 0; }