It’s old, it’s been used a million times before, but I guarantee it’ll fix 99.9% of the margin and padding errors you’ll come across. The Universal Zero Rule is a very simple snippet of CSS that you can add to the beginning of your CSS document.
Many times when coding a page using CSS you’ll find that even though you’ve specified certain padding and margin values they may be off by a few pixels, mainly because each browser has it’s own default value, which it will add to the element. The UZR resets these values to zero so that you can define your own measurements without having to worry about browser interference.
Simply add it to the beginning of your CSS document and it should fix most of the problems you’ll come across without the need for hacks or other workarounds. Copy and paste and you’ll be all set. If you want you can even define and overwrite default browser colors, backgrounds, etc by adding other properties to the selector.
*{
margin: 0;
padding: 0;}






1 Comment
September 7, 2006 at 4:10 pm
Also there’s the YUI reset.css file that resets everything for you.