Why people add padding:0; on body element? I don't see any point in that. All browsers use default margin:8px; on body not padding. Am I missing something ? Is there any quirks?
* {
margin: 0;
padding: 0;
}
This is part of the "CSS Reset" theory which helps keep your designs consistent across browsers, a very good thing. Unfortunately this is not a good practice. It is very heavy on the rendering agent to apply rules to every single element in the document, especially with large web pages, and this can also destroy a lot of good default styling, especially when you want to have default styled submit buttons.
If body { margin: 0; } is used, all other standards compliant browsers (excluding Opera) will set items into the top left corner of the window.
If body { padding: 0; } is used, only Opera (both Mac and Windows) will set items into the top left corner of the window.
The best way to set items into the top left corner of the window is to use body { margin: 0; padding: 0; } which will work for all standards compliant browsers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With