Grow your CSS skills. Land your dream job.

Reset all Margins & Padding

Published by Chris Coyier

* {
margin: 0;
padding: 0;
}

This has become a very popular technique lately, and for good reason. It removes all default margin and padding for every object on the page, no holds barred, regardless of browser. This provides a nice clean slate for design and ensures that all spacing is intentional, explict, and ubiquitous across browsers. There is no reason not to do this.

Some people like to include border: 0; as a part of it, but it has been found to not be effective in all situations (including the annoying borders>, so why bother...

If you wanted to go completely bat poop crazy on reseting every possibly everything, check this out.

This comment thread is closed. If you have important information to share, you can always contact me.

*May or may not contain any actual "CSS" or "Tricks".